Warning: I’m a few days into learning AppleScript, so bear that in mind…
I’m trying to make an applescript in DevonThink Pro that will do the following:
Take my selected text notes and create a new text document with the same title, but remove the path of the original.
Using Hazel, I’ve copied a lot of notes over from Notational Velocity folder into DevonThink Pro. I’ve deleted them from SimpleNote, so now DevonThink Pro has a missing file error. I just want to create a new note with the existing title so I can start to work on it in DevonThink Pro.
I’ve been tinkering with the following script, but I’m unsure what to do or if I’m even on the correct path…
tell application "DEVONthink Pro"
set theDatabase to current database
set theSelection to selection
set file_name to filename
get filename of selection
set resultObject to make new simple ¬
at atInsertionLoc ¬
with data withDataAnything ¬
with properties withPropertiesValue
end tell
I believe I’m doing well until I get to the resultObject part. Using ScriptDebugger, I copied the syntax for “Make” function. I’m not entirely sure this is what I want to do, though.
I’m having trouble figuring out what “resultObject” would be? What would create the new text document?
I think I would just remove InsertionLoc and DataAnything???
and make “with properties file_name”
Any ideas, recommendations, thoughts, critiques, laughing & pointing, help would be nice. Thanks