View Full Version : Launching PDF from Projector File w/ Applescript
wyclef
04-28-2004, 06:10 PM
Hello,
I'm trying to launch a PDF from a flash projector on a mac using the exec fscommand and an applescript. Inside a disc image the applescript works fine on it's own with the PDF but when trying to trigger it from the projector i'm not having much luck.
Here is the actionscript being used.
on (release) {
fscommand("exec", "fscommand/cdromTest_script1.app");
}
What do you think?
oldnewbie
04-28-2004, 07:30 PM
These might help solve your problem....
http://www.flashkit.com/board/showthread.php?threadid=264064
http://www.actionscript.org/forums/showthread.php3?s=&threadid=5843&perpage=30&pagenumber=1
wyclef
04-29-2004, 12:07 PM
Thanks Newb,
I'll check those out.
wyclef
05-02-2004, 02:36 PM
Ok, so I've got the Mac thing figured out. Now on a PC i've got...
on (release) {
fscommand("exec", "js_class_2003.pdf");
}
And it doesn't work. What special things should I take into account for launching PDF on PC? Is there an applescript equivalent on a PC i'm supposed to use? Shouldn't the exec command just work on PC?
oldnewbie
05-02-2004, 05:59 PM
Nope! You need to use a batch file (.bat) on PC.
The batch file must be in the fscommand subfolder along with the .pdf file, and your action would be...
on (release) {
fscommand("exec", "my_pdf.bat");
}
Check this thread on FK...
http://www.flashkit.com/board/showthread.php?threadid=423561
wyclef
05-03-2004, 10:52 AM
Thanks Old Newb,
So here's where i'm at. I've got a bat file (made on a mac txt editor) that is as follows
launch_brand_msg.bat
@ echo off
start js_brand_msg.pdf
exit
Then i've got a button that is coded...
on (release) {
fscommand("exec", "launch_brand_msg.bat");
}
I have tested this with the PDF inside and outside the fscommand folder and in both cases only the DOS window opens up with the word "OFF" displayed, and acrobat is not launched. I am running WIN 98 SE, and Acrobat 5.05.
wyclef
05-03-2004, 04:48 PM
is it open filename or start filename for the bat file. any advice about naming conventions?
oldnewbie
05-04-2004, 01:18 AM
It's start, not open! And the .pdf should definately be in the fscommand folder, but this fscommand subfolder must be a direct subfolder to the folder in which lies your projector file.
That should normally work!
wyclef
05-04-2004, 10:35 AM
What is the appropriate way to create a batch file on a mac? Right now I am just using BBEdit and saving it out as text and then giving it the .bat extension. Also, is it possible that when i'm burning the CD i'm burning it in a way for PC format which would mess up the paths or filenames? I just don't get it. My code seems to be correct.
wyclef
05-04-2004, 11:19 AM
Hold up folks, I think i'm on the verge of figuring this stuff out. Apparently there is an option on the mac when you are saving out txt files for PC where you can select "DOS Line breaks". I opened up one of my mac bat files on the PC that didn't have this feature embedded and instead of line breaks everything was on one line and there was a rectangle shape everywhere there was supposed to be a line break. This HAS to be the problem. If not it's all over man. Ok, i'll let everyone know the scoop soon!
wyclef
05-04-2004, 05:09 PM
Nice. Everything working now. Yay! So, moving on here, with the batch files, is there a way to type some code after @echo off that would minimize the DOS window?
Slowburn
05-04-2004, 06:22 PM
I assume you can't use the getURL()?? Wouldn't that be easier?
wyclef
05-04-2004, 06:27 PM
doesn't getURL have to open up a browser to retrieve the file? isn't it only good with links?
Slowburn
05-04-2004, 06:38 PM
Yes, this is true. it will open the browser, but the PDF will display inside of it.
I guess this is the dilema, open in browser or open in Acrobat...if they have acrobat instaled...
oldnewbie
05-04-2004, 09:16 PM
What OS? With ME, works fine for me by creating a shortcut that runs the DOS window minized, but I don't really know of to achieve this on other OS's.
wyclef
05-05-2004, 09:28 AM
Win 98SE. If I creatte a shortcut that runs the DOS window minimized, do I target the shortcut in flash or still the original batch file?
oldnewbie
05-05-2004, 11:06 AM
The original batch file, but the shortcut must be in the fscommand subfolder.
TLynn721
07-06-2004, 03:41 PM
I've been following this thread since I was having the exact same problem. I created the shortcut for the .bat file but I am still getting a DOS pop up (briefly) before the .pdf opens. I'm using Windows 2000. Any suggestions?
Thanks :)
oldnewbie
07-06-2004, 03:47 PM
Might be different on 2000, don't really know since I'm on ME!
You have to find a way that makes the bat file run minized. Maybe ask on a Windows 2000 forum?
vBulletin® v3.7.1, Copyright ©2000-2008, Jelsoft Enterprises Ltd.