PDA

View Full Version : [AS3] FSCommand for Mac/Applescript


NightmareTaco
02-11-2011, 06:56 PM
I've been trying for the past few days to get my Flash App to open up an Applescript or a .app. Right now, it works perfectly in Windows (with bats and exes). I just can't for the life of me get it to work on a Mac. (I'm using Snow Leopard).

This is the simple code:
fscommand("exec", "test.app")

I've tried putting the files in every place I could imagine. Inside a "fscommand" folder, inside the Contents and MacOS folders in the App; everywhere. I've also tried telling Flash to run a "scpt" file instead. I tried using Flash Player 9 but that didn't help either.

So, for Flash Player 10, with ActionScript 3, is there any way to run an applescript/app from a Flash App projector? (There are plenty of solutions for AS2 and Flash Player 8, but I need to use AS3.)

Thank you!...

(edit: I'm using Flash CS5, and yes, the Applescript works by itself.)

northcode
02-14-2011, 02:09 PM
Did you compile the script? If you do that you can't edit it, but you can EXEC it from Flash. I've had nothing but trouble getting uncompiled scripts to run.

NightmareTaco
02-14-2011, 03:13 PM
Yeah it's compiled, at least I think so. I clicked the little hammer, there were no problems, saved it, ran fan, but Flash won't pick it up. I can still edit the applescript, though... (and then compile it again). Am I missing something? I'm pretty new to applescript.

By the way your proxy.exe for fscommand/bats is the best thing ever. :)

northcode
02-14-2011, 07:20 PM
For CS3 and later the fscommand folder has to be in Projector.app/Contents/MacOS inside your projecftor, if it's not, it won't be found. This will mess up the paths you're using if you assume the AppleScript is running in the same folder as your projector. Create a simple script that just displays a dialog and see if that works so you know the script is running before you try anything more advanced.

darith
05-13-2011, 09:55 PM
For CS3 and later the fscommand folder has to be in Projector.app/Contents/MacOS inside your projecftor, if it's not, it won't be found. This will mess up the paths you're using if you assume the AppleScript is running in the same folder as your projector. Create a simple script that just displays a dialog and see if that works so you know the script is running before you try anything more advanced.

Adobe Flash CS5 no longer supports running a file in fscommand inside of the Projector.app/Contents/MacOS. The solution is to save the FLA file to a CS4 version and then publish the Projector.app file from Adobe Flash CS4. Hopefully, CS5.5 has fixed this bug.

northcode
05-14-2011, 12:09 AM
I don't have CS5 to test with but maybe they "fixed" it by allowing the fscommand folder to be where it's "supposed" to be, in the same folder as the .app. Can anyone with CS5 confirm that? I guess I'd better get me a copy of CS5.5 now...

jim_peru
06-06-2011, 08:40 PM
Is not working in CS5...

I don't have CS5 to test with but maybe they "fixed" it by allowing the fscommand folder to be where it's "supposed" to be, in the same folder as the .app. Can anyone with CS5 confirm that? I guess I'd better get me a copy of CS5.5 now...

flashpipe
09-24-2012, 06:27 PM
Anyone know if this works in CS6? I've got my .app, .bat, .exe and target files in an fscommand folder and put it in my start.app folder, the Contents folder and the MacOS folder and it doesn't work...everything works fine on the PC...wondering if this might be the problem...anyone ever get this to work?