Hey guys,
I’m calling an applescript from a flash file to open an adobe reader file. the code i use is the following:
--set the name of the file to open
property fileName : "thedocument.pdf"
--get the path to the containing folder
set myPath to (path to me as string)
set AppleScript's text item delimiters to ":"
set the parentFolder to ¬
((text items 1 thru -2 of myPath) & "") as string
set AppleScript's text item delimiters to ""
-- find the flash file
try
set targetFile to alias (the parentFolder & fileName)
on error
--ie if there's no file here by this name, it will quit.
return quit
end try
tell application "Finder"
open file targetFile
end tell
As you can see, the code gets the path to the applescript file inside the fscommand folder and opens the pdf in the same folder as the applescript.
The code works perfectly on my machine. However to distribute the whole 70MB package (2 flash projectors and 100+ pdf’s) I compile it into a disk image. Again once mounted it still works fine on my machine. However, once i post it to one of my collegues, and they mount the image and run the flash file, the applecript returns an error saying it cant get the file…?
I’m afraid i’ve only been able to teach myself the absolute basics of applescript, but am a keen learner and any help eould be fantastic regarding why it is happening and how i can get around it?
Cheers