The stack needs to open the user guide (a PDF file) from the same folder/directory as the stack then the user clicks a certain button. I need this to work from the hard drive (on both platforms) as well as from the CD once it's burned. And I need it to work in development mode as well as on the player. Obviously, I cannot use an absolute path to the file; it must be relative to the stack.
In order to solve the development mode problem I use the following script in preOpenStack:
Code: Select all
get the filename of this stack
split it using "/"
delete variable it[number of lines of the keys of it]
combine it using "/"
set the defaultFolder to it
I also use the following script to find the user guide (for opening later), which can have several name variations as well as the revision:
Code: Select all
global guide
repeat with x = 1 to the number of lines of the files
get line x of the files
if it contains "User's Guide" then
put it into guide
exit findGuide
end if
end repeat
When the button is clicked here is how I open the file:
Code: Select all
global guide
if guide is empty then
answer "I can't find the User Guide. Please check the disk."
else
launch document guide
if the result is not empty then
answer the result && guide && "in" the defaultFolder
end if
end if
Why can I correctly find the file but not launch it on the Mac? Is there a way to get more error/debug information out of Revolution than just "can't open file"? Any help or suggestions would be greatly appreciated.
TIA,
Troy