I’m trying to set up a system to have Hazel automatically move a file into a specific DT folder. I know little/nothing about scripting, but using this info (noodlesoft.com/forums/viewto … f=3&t=4694) I thought the short shell script below would work to move test.pdf into the folder Test in my DT database. It does not. I would appreciate any suggestions. Thanks!
–Aaron
#!/bin/sh
tell application id “com.devon-technologies.thinkpro2”\n
launch\n
set theDatabase to open database “/Users/Aaron/Documents/DevonTHINK/Personal.dtBase2”\n
import “/Users/Aaron/Desktop/DTtest/test.pdf” to Test\n
end tell\n
“Import” requires a location, and so the syntax for “import” is
set theGroup to create location "/Test" in theDatabase
set theResult to import "/Users/Aaron/Desktop/DTtest/test.pdf" to theGroup
If the location (/Test) already exists, the first statement will not create it, but will only assign the address to theGroup. theResult is required by the syntax, and is a record variable, so you could address theResult to set tags or other properties of that record.