PDA

Click to See Complete Forum and Search --> : Help opening a pdf with a projector mac-pc



kelvan
06-11-2001, 09:21 AM
Hi,

Im trying to make a projector movie that links to a pdf (in the same folder) on a CD that needs to run in both windows and mac. Im able to get it to work on a pc but not on mac. here is the code for the button i used in the projector.

on (release) {
fscommand ("exec", "start\tFile.pdf");
fscommand ("exec", "cmd\t/c\tFile.pdf");

so i want to do the same thing for mac, that is using the fscommand to open up a pdf in acrobat. I read messages here that use applescript but i dont understand it too well so what id like to know if possible is the applescript, what it does and do i apply it to the button in my projector or do i tell the button to look at the applescript or what? I guess thats it for now.

thanks,
Kelvan

Mac8myPC
06-12-2001, 02:36 PM
i would try just plain ole - ("exec", "file.pdf"); and see if that works.

kelvan
06-12-2001, 04:22 PM
too easy to work. i tried that and it didnt work on mac. thank you though.

kelvan

me2222
06-13-2001, 05:19 AM
Yes, on Mac you can only open applications with the "exec" command.
To open documents you have to start an executable applescript that opens the document.
I´m not an applescripter, but making the needed script is easy. I once started to make a tutorial about that issue, but never finished it because of lack of time.

I don´t have the files at hand now, but I could send you some stuff when I am at home this evening.
Email me if you need it.

kelvan
06-13-2001, 08:29 AM
Hi

yes i would appreciate the applescript, and a little on how to use it if possible. i never did this before so treat me like an idiot.

thanks again
kelvan

fyi: the projector is called default and the pdf is called file and they are in the same directory.

SJT
06-13-2001, 08:41 PM
This should be what you need; open apple's script editor, paste this code in and save it as a classic applet.

you need to change the property fileName to the name of the file you want to open.
then fscommand exec with this script as the target.


--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

kelvan
06-14-2001, 03:57 PM
thanks

this is what worked for me. I had figured it out before getting this response. i wanted to post it for others references:

heres my applescript.

tell application "Finder"
activate
select file "file.pdf" of folder "test"
open selection
end tell

heres the button comand for the projector:

on (release) {
fscommand ("exec", "open");

hopefully this of use to anyone interested. Please email if there are any questions.

thanks again for all the help.

SJT
06-14-2001, 04:06 PM
yeah, your's is simpler, but mine doesn't care what the folder's called...

Waltz
11-28-2001, 01:18 PM
Hello blokes,

Just to expand on the whole Flash acrobat launching issue. I am also launching a .pdf through a flash CD-Rom interface. I have used the 'getURL' method which is simpler but opens Acrobat Reader into your default browser(Macs included). I think I will use the method you two have shown as it looks pretty cool.

I also want the end users of my Cd-rom to be able to install 'Adobe Acrobat Reader' from the Flash CD-Rom interface aswell.
I have used the ('Exec' 'acrobat_pc.exe') successfully for the PC projector, and I have attempted to use ('Exec' 'acrobat_mac.bin') function on the Mac projector - but it does not work!!

Does anyone know to launch 'Acrobat.BIN' Installer -through a flash projector???

SJT
11-28-2001, 03:24 PM
bin files are not executables, they are a form of encoding that maintains macintosh file formats across platforms.
The acrobat installer file you want is inside this bin file. But, if you're on a PC, decoding this file will break the installer for macs...

Waltz
11-29-2001, 05:26 AM
Thanks, as u can probably tell - im not a Mac person!

So if I un-BIN or extract the Acrobat installer file from the .Bin file and leave it untouched by a PC. I should then be able to target it with ('Exec' 'Acrobat Installer') fsCommand??? right?

(bearing in mind that the 'Acrobat Installer' file will be wrote to a mac volume straight away ready for Hybrid CD burning)

Thanks for your help

L

SJT
11-29-2001, 06:32 AM
yeah, if you decode it on a mac without it touching a pc it will be fine on a hybrid

sctrob
11-29-2001, 10:50 AM
From what I have heard...and the above comments as well, the Fscommand function does not work in Mac.

I have used the getURL action and works like a charm...

sctrob
11-29-2001, 10:53 AM
Any mac users help me out with my thread?

http://board.flashkit.com/board/showthread.php?threadid=237229

much appreciated...

SJT
11-29-2001, 11:57 AM
Originally posted by sctrob
From what I have heard...and the above comments as well, the Fscommand function does not work in Mac.

I have used the getURL action and works like a charm...

The FSCommand works exactly as documented.
An undocumented feature of the windows version fo the flash player is that it opens documents as well as applications.

Waltz
11-30-2001, 08:07 AM
Hello again Mac people,

I am using the Applescript that Kelvan wrote and included in his earlier thread:
---------------------------------
tell application "Finder"
activate
select file "file.pdf" of folder "test"
open selection
end tell
-----------------------------------------
heres the button comand for the projector:

on (release) {
fscommand ("exec", "open");

and it works a treat! However, I want to put the Applescript file into a sub-directory on the Cd-rom and then 'target' the Applescript in that sub-directory from the Projector which is obviously in the rood of the CD-rom.

I have tried simply using:

on (release) {
fscommand ("exec", "folder1/folder2/open");

as obvious as it looks it DOES NOT WORK!! ..the command doesnt seem to make it through the sub-folders!!!
can anyone help me out here?? will I have to accept that the applescript will have to stay in the root of the CD-rom??

Much appreciated.

Lee

Waltz
11-30-2001, 08:56 AM
Well I've sorted it! ...

extracted from macromedia.com:

Solution
Before compiling the Flash movie as Macintosh projector, change to colons any slashes being used in folder pathnames.

For example, on a Windows system, the following code in will properly launch an application (myProjector.exe) that's located in another folder ('folder', in this example):


fscommand ("exec", "/folder/myProjector");

On a Macintosh platform, the syntax above will not correctly target the projector file. The correct syntax for the same directory path as above for the Macintosh is as follows:


fscommand ("exec", ":folder:myProjector");


I hope this helps any of you!?

Cheers

pjutter
03-20-2004, 12:59 PM
Originally posted by SJT
This should be what you need; open apple's script editor, paste this code in and save it as a classic applet.

you need to change the property fileName to the name of the file you want to open.
then fscommand exec with this script as the target.


--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

Hi, I want to try using this to make Applescripts. I'm only a PC user so don't understand Applescripts very well. But I'm happy to go out and borrow a Mac to make these. If I just paste in the code above, is the filename the only thing I need to change?

My PDF's are in a folder called fscommand. Can I reference them in that folder? If so, how do I change this line?


property fileName : "thedocument.pdf"

And is that the only line I need to change? I have no idea what the other lines are about.

And one more question... if I save the applescripts onto a PC, will they lose their attributes? I'm hoping to burn the CD on a PC (using CDeverywhere) to make it a hybrid. But I'm wondering if transferring applescripts onto a pc computer would corrupt them (?). I won't be opening them or anything there.

Phyllis


Thanks for any help!

SJT
03-22-2004, 08:24 AM
That's the only line you need to change, just put the applescript in the same folder as the document you want it to open. It only needs to be the document name.

If you want to transfer the scripts over from a mac to a pc, you should .hqx the scripts first and then use CDEverywhere's hqx decoding for when you make the disc image.
You can find lots of hqx encoding utilities at www.versiontracker.com in the mac section.

pjutter
03-22-2004, 10:13 AM
Thanks so much!!!

I think I've just about gotten it now. Just gotta do a few tests...

I'll check out the encoding utilities you suggested (was wondering about that part).

Thanks again,
Phyllis

abraxas37
04-18-2008, 02:41 PM
hi

the applescript of kelvan works very well, but the link from the swf or mac projector doesn´t works: when I click the button, nothing happens.

can anybody help me?

the_dex
05-05-2009, 08:18 AM
thanks

this is what worked for me. I had figured it out before getting this response. i wanted to post it for others references:

heres my applescript.

tell application "Finder"
activate
select file "file.pdf" of folder "test"
open selection
end tell

heres the button comand for the projector:

on (release) {
fscommand ("exec", "open");

hopefully this of use to anyone interested. Please email if there are any questions.

thanks again for all the help.

Hi and thanks for the info.
The applescript, does it have to be named "open.app" then or something?
Because I don't see how fscommand ("exec", "open") knows what file to open.

And is there another way needed to do this on a linux platform ?
Or will it work just as well ?

thanks in advance :)

Bruceleeroy
10-14-2009, 05:46 PM
Hey guys I have been trying the suggestions everyone has been posting here for hours and cant get this pdf to open.

You can see how I have everything set up in the image below
http://i38.tinypic.com/2i6chs1.jpg

And here is all the code:

BUTTON:

on (release) {
fscommand ("exec", "open");
}


applescript:

tell application "Finder"
activate
select file "ym.pdf" of folder "test"
open selection
end tell

Anyone know whats going on?