A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 23

Thread: Help opening a pdf with a projector mac-pc

  1. #1
    Junior Member
    Join Date
    Apr 2001
    Posts
    18
    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

  2. #2
    Now listen heah! Mac8myPC's Avatar
    Join Date
    Aug 2000
    Location
    Steve Job's Doorstep
    Posts
    695
    i would try just plain ole - ("exec", "file.pdf"); and see if that works.


  3. #3
    Junior Member
    Join Date
    Apr 2001
    Posts
    18
    too easy to work. i tried that and it didnt work on mac. thank you though.

    kelvan

  4. #4
    juggernart me2222's Avatar
    Join Date
    Jun 2000
    Posts
    1,322
    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.


  5. #5
    Junior Member
    Join Date
    Apr 2001
    Posts
    18
    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.

  6. #6
    Senior Member SJT's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    2,563
    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.

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

  7. #7
    Junior Member
    Join Date
    Apr 2001
    Posts
    18
    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.

  8. #8
    Senior Member SJT's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    2,563
    yeah, your's is simpler, but mine doesn't care what the folder's called...

  9. #9
    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???

  10. #10
    Senior Member SJT's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    2,563
    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...

  11. #11
    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

  12. #12
    Senior Member SJT's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    2,563
    yeah, if you decode it on a mac without it touching a pc it will be fine on a hybrid

  13. #13
    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...

  14. #14
    Any mac users help me out with my thread?

    http://board.flashkit.com/board/show...hreadid=237229

    much appreciated...

  15. #15
    Senior Member SJT's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    2,563
    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.

  16. #16
    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

  17. #17

    Smile

    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

  18. #18
    Senior Member
    Join Date
    May 2003
    Location
    Vienna, VA USA
    Posts
    116
    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.

    Code:
    --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?

    Code:
    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!

  19. #19
    Senior Member SJT's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    2,563
    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.
    Sam



  20. #20
    Senior Member
    Join Date
    May 2003
    Location
    Vienna, VA USA
    Posts
    116
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center