I think I know the answer here but there are a lot of clever people out there…
Can I create an Applescript from a text file and save as a app?
I think I know the answer here but there are a lot of clever people out there…
Can I create an Applescript from a text file and save as a app?
Hi weedinner,
Here’s an example:
set f to choose file
set pp to POSIX path of f
set app_name to "~/Desktop/TestApp.app"
do shell script "osacompile -o " & app_name & space & pp
The chosen file is the text file with the script text.
Edited: see ‘man osacompile’ in Terminal for more options. For instance you can use the -x flag for execute only. Not sure if that’s what you wanted.
gl,
kel
Model: MBP
AppleScript: AS 2.2.4
Browser: Safari 536.28.10
Operating System: Mac OS X (10.8)
Thanks you kelp. Perfect
Hi weedinner,
Glad it worked, but I forgot something. I should have used ‘quoted form’ in case the file paths have spaces in names:
set f to choose file
set pp to quoted form of (POSIX path of f)
set app_name to "~/Desktop/TestApp.app"
do shell script "osacompile -o " & app_name & space & pp
Hope you come back. I was on the road when I remembered.
gl,
kel
Thanks kel1