Applescript & Runtime Rev
Posted: Wed Feb 20, 2008 3:52 am
Greetings All,
I am writing the script to create a Mac Installer for one of my programs. I have never used Applescript before, but it appears that it is what I need to determine the size of various folders. I am using the following script:
tell application "Finder"
set x to ":Users:johnmiller:Desktop:MISC Folders" as alias
get physical size of folder x
set y to result
set y to (y / 1024 / 1024 / 1024)
end tell
This runs great in Apple's Script Editor, but when I place the script in a card field (cd fld "myScript") and use the following script in a button, I get the error message ("execution error").
on mouseUp
do cd fld "myScript" as appleScript
put result ()
end mouseUp
If I run just the first 2 lines of the script, x is returned as the result and reports correctly. When I add the next line "get physical size of folder x",
I get the "execution error" message.
Does anybody have any ideas and/or expertise they would like to share?
Oh, I have played around with various other applescripts in Revolution, and they have all worked the same as in Apple's Script Editor. I can't figure this one out.
Thanks,
John Miller
I am writing the script to create a Mac Installer for one of my programs. I have never used Applescript before, but it appears that it is what I need to determine the size of various folders. I am using the following script:
tell application "Finder"
set x to ":Users:johnmiller:Desktop:MISC Folders" as alias
get physical size of folder x
set y to result
set y to (y / 1024 / 1024 / 1024)
end tell
This runs great in Apple's Script Editor, but when I place the script in a card field (cd fld "myScript") and use the following script in a button, I get the error message ("execution error").
on mouseUp
do cd fld "myScript" as appleScript
put result ()
end mouseUp
If I run just the first 2 lines of the script, x is returned as the result and reports correctly. When I add the next line "get physical size of folder x",
I get the "execution error" message.
Does anybody have any ideas and/or expertise they would like to share?
Oh, I have played around with various other applescripts in Revolution, and they have all worked the same as in Apple's Script Editor. I can't figure this one out.
Thanks,
John Miller