A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: exec command in mac projectors

Hybrid View

  1. #1
    Member
    Join Date
    Aug 2000
    Posts
    33
    I have made a projector in mx, and have used fscommand to execute two other projectors from this file, for windows. But can I do the same thing for mac? The individual projectors are running perfectly in macintosh, but the fs command to execute other projectors is not working. I had created a folder named fscommand and put the other two projectors in it, as we do for windows. But it isn't working. Any help would be greatly appreciated.

  2. #2
    Junior Member
    Join Date
    Jun 2001
    Posts
    25

    Post

    I recently ran into some frustration with exec in fscommand on my Mac. Last night I wanted my projector to execute an AppleScript when I clicked on a certain button. I could get it to work under Flash 5, but not MX. Then I read about having to use the fscommand folder for security reasons. Now I've got it doing what I need it to.

    The thing that may be throwing you off if you are developing under OS X is that most applications have an invisible ".app" extension. For instance, an AppleScript compiled as an application and saved with the file name "hello.app" (as is common practice) shows up in the Finder as "hello". However, when calling this application from your Flash projector, you have to:

    1. Make sure the app is in a folder named "fscommand" in the same folder as the projector

    2. You specify the app's name as having the ".app" extension on it (i.e. "hello.app")

    3. That you actually publish a projector to test it - building a test (Apple + Enter) won't do it for you

    4. Make sure the name of the app you are trying to launch does NOT have any spaces in it (i.e. "hello there.app")

    5. I also read somewhere on these forums that there are other rules that the name of the app to be launched has to follow, but I can't remember any others right now - but I did confirm the space issue. Search the forums for the thread I am talking about (I will do so also when I have time).

    Hope that helps. I haven't tested any of this under OS 9 yet, but the exec command is working for me under OS X now that I have some more info to go by. Happy day.

    -Matt

    PS--You can check the true name of a file/application using the Finder by doing a Show Info (Apple + I) on the file and then pulling down the drop-down list to "Name & Extension." You can also use the Terminal ("ls -l /path/to/fscommand") if you are more comfortable with the command line.

  3. #3
    Junior Member
    Join Date
    Jun 2001
    Posts
    25

    mx fscommand restrictions

    Here is the link to the thread that lists some of the restrictions for the fscommand in Flash MX. I think you already posted to the thread, but it was above the post that lists all the rules, so perhaps you were just too quick.

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

    Security is fun!

  4. #4
    Member
    Join Date
    Aug 2000
    Posts
    33
    Thanks a lot for your help. In fact I had found the FAQs posted by SJT in this forum itself. But I am having problems with the instructions given for writing AppleScript, as I haven't handled the mac before. Do you know how to write the Script?

  5. #5
    Junior Member
    Join Date
    Jun 2001
    Posts
    25

    Post AppleScript

    Originally posted by ghaps
    Thanks a lot for your help. In fact I had found the FAQs posted by SJT in this forum itself. But I am having problems with the instructions given for writing AppleScript, as I haven't handled the mac before. Do you know how to write the Script?
    Yes, I do know how to write some AppleScript. But I am by no means a "pro" at it or anything like that.

    Let me know what you need the script to do and I will see if I can help you.

    -Matt

  6. #6
    Member
    Join Date
    Aug 2000
    Posts
    33

    without applescript

    Hi Matt,
    I found the following info in this forum itself.

    [[[ "When opening files on a MAc, you don't have to use applescript, you can use the FS command. The major difference between pc and mac opening files is how you path them. This is what a Mac fs command for opening files looks like.
    Fs Command("exec", "Macintosh HD:Folder:File"
    You have to start at the macintosh HD if you are going to any folder other than the current folder, and you have to use :'s instead of /'s." ]]]

    I am trying with this solution currently. Again, if I burn the files on a CD, then the problem arises if I should give the path name starting from Macintosh HD. Also whether I should specify the FScommand folder in the path, since we do not write the folder name in Windows.
    If I can't come up with a solution without the AppleScript, I'll obviously ask for your help with the coding. Thanks indeed for your generous help.

  7. #7
    Member
    Join Date
    Aug 2000
    Posts
    33

    Smile file extension

    Another thing, do you know the file extension for the mac projector? I haven't found the extension for mac as it is '.exe' for Windows.

  8. #8
    Junior Member
    Join Date
    Jun 2001
    Posts
    25

    Post

    The extension for a Mac projector (any Mac app) under OS 9 is... nothing. Mac apps don't need an extension to run. Many apps under OS X will have a ".app" extension, but it is not necessary.

    As for executing the other projectors using the fscommand, it should work the same as in Windows. You just need to put the projectors to be executed into the fscommand folder and then use the "exec" paramater of fscommand to run the program. I'm doing this right now and it works. A couple things to check:

    Make sure the projectors you are trying to execute are Mac projectors - Windows projectors can't be run on a Mac (and vice-versa).

    Make sure the projector you are trying to run with the fscommand will run all by itself by double-clicking it in the Finder. No sense in trying to make a projector run that is broken. =)

    If you need to specify a path on your CD on the Mac side, go ahead and use the CD's name. Macs don't use drive letters, so the CD will be available by its name (Windows users may call this the CD's label) on every Mac. If your CD is named "My Stuff" then any Mac you plug it into should understand this path:

    My Stuff:Pictures:Nature:Picture 1.jpg

    Please note that I haven't tested calling projectors in this manner on the Mac and I can't test it at the moment. With the new rule of having to use the fscommand folder, I'm not sure how paths apply anymore. I need to experiment more. ;-)

    Hopefully, that helps you out some, rather than confuse you. Let me know how it is going and I will continue to try and help you.

    -Matt

  9. #9
    Senior Member
    Join Date
    Jun 2000
    Location
    London
    Posts
    293

    for testing

    you seem to have most things covered. As for writing applescript their really isn't much needed. You can record the action that you want it to do. then just edit the pathname in the applescript so that it says mycd:etc. instead of macintosh hd:etc.

    For testing purposes you can make a disk image of your cd - using shrinkwrap/diskcopy. Then you can test your pathnames to see wether they work.

    BenG

  10. #10
    Member
    Join Date
    Aug 2000
    Posts
    33

    it's very easy

    Hello Matt. The process is very easy for FlashMX. For using the "exec" command in mac, you just need to place the second projector inside a folder named "FScommand", and this should lie in the same level as the parent projector file. Also, in the "exec" command parameter box, you just need to write the name of the application, and no file extensions(as you told). That's it. Sufficient to launch the projector. Thank you.

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