I'm trying to write an AppleScript to make a temporary alias on the desktop from a folder that resides in the Bundle's Contents:Resources folder and then execute a terminal command that has an argument from a file that also resides in the Bundle's Contents:Resources folder and then remove the temporary alias from the desktop upon finish or exit.
How do I fix the following code to accomplish this?
set myRes to (path to me as text) & "Contents:Resources:"
tell application "Finder"
make new alias to folder myRes & "Pass-Through Drive" at desktop
end tell
tell application "Terminal"
activate
do script myRes & "BasilliskII --config basilisk_ii_prefs"
end tell
tell application "Finder"
delete file "Pass-Through Drive" of desktop
end tell
This is the error I get:
error "Can’t make «class cfol» \"Resources\" of «class cfol» \"Contents\" of «class appf»
\"Mac OS 8.1.app\" of «class cfol» \"Desktop\" of «class cfol» \"ryan\" of «class cfol»
\"Users\" of «class sdsk» of application \"Finder\" into type list, record or text."
number -1700 from «class cfol» "Resources" of «class cfol» "Contents" of «class appf»
"Mac OS 8.1.app" of «class cfol» "Desktop" of «class cfol» "ryan" of «class cfol» "Users"
of «class sdsk» to list, record or text
I think I've corrected it down to...
set myRes to (path to me as text) & "Contents:Resources:"
tell application "Finder"
make new alias to folder (myRes & "Pass-Through Drive") at desktop
end tell
tell application "Terminal"
activate
do script myRes & "BasilliskII --config " & myRes & "basilisk_ii_prefs"
end tell
tell application "Finder"
delete file "Pass-Through Drive" of desktop
end tell
but still having trouble with the middle lines and the proper syntax of what I'm trying to accomplish.