How do I use AppleScript/Automator to make a service that'll make an empty AppleScript file in the selected folder?
A:
You want to use the command line utility osacompile. The following will create a blank applescript on your desktop called "test.scptd"
set applescriptCode to ""
set applescriptPath to (path to desktop as text) & "test.scptd"
do shell script "echo " & applescriptCode & " | osacompile -o " & quoted form of POSIX path of applescriptPath
regulus6633
2010-10-25 20:12:03
Thanks a lot, but I keep getting this error: error "Finder got an error: osacompile: couldn't write to file /Library/Application Support/App/Script.scpt: No such file or directory" number 1
magikseb
2010-10-29 17:56:37
The error sounds like there's something wrong with your path. Since you didn't show any of your code I can't be sure. I'm sure my code works as-is so whatever you changed is what got messed up.
regulus6633
2010-10-31 03:33:30