Executing JSFL files

My favorite feature of Flash 2004 is the addition of an extensibility layer into the IDE. This allows you to use JavaScript (JSFL) to script the IDE.

Did you know that you can execute JSFL files from outside of Flash? There are two ways to do this. The first is to simply double click the jsfl file. Flash 2004 will open up and execute the JSFL contained within the file.

The second is to call the Flash 2004 executable from the command line passing the JSFL file as the first argument:

flash.exe command.jsfl

This will open Flash and execute the commands within the jsfl file.

Among other things, this will allow you to process Flash movies from the command line.

You cannot pass arguments to the JSFL file though, but one work around is to create another program that dynamically writes out the JSFL file, and then executes it.

13 Responses to Executing JSFL files

  1. Paul says:

    that’s cool… so, can you build windows swf’s and execute .jsfl’s from there? How do you interface them with Flash? When can we expect the documentation?

  2. JX says:

    Macromedia Flash MX 2004: Putting the “Application” in RIA”Custom tools are not terribly difficult to program. For example, I saw one that extends the standard Line tool by automatically drawing arrow heads as you draw lines. Another produced a quick 3D cube. It’s basically nothing more than a bit of math, the JSFL language, and XML to UI (for parameter dialog boxes).”So who’s gonna get the ball rolling?

  3. J. says:

    Hey Mike, how about a few words about the bugs in FMX2004? no one from Macromedia seems to care about it, according to the company’s presence on macromedia.flash group…

  4. Hey Mike,I agree that JSFL is great. I have already written a few extensions that were needed for our workflow.The people that will really benefit from this feature are teams of developers. The extensions I have written so far have been extensions to guarantuee the proper transfer of files between our developers and designers. (A constant problem)The best one so far organizes libraries and sorts all symbols into proper folders. Not only that it segregates badly named symbols so I can it back to the designer to sit down and name them properly.It’s fun.The only issue I am having now, is trying to populate an XMLUI dialog with data that has been gathered by a JSFL file.In my find in Library extension, I want to post all of the results of found symbols to a select list. there the user can ick a symbol and it will, expand the entire path down to it, select it, and go to edit mode for it.All that is done, but how do I populate the select list from JSFL?I saw the fl.xmlui object, but when the panel launches, the script pauses. How do I manipulate it?Anyways, JSFL is definitely awesome, and will optimize workflows everywhere.

  5. Regarding: “can you build windows swf’s and execute .jsfl’s?”—check out MMExecute().Build a string of your JSFL, pass it to MMExecute()–works great.Doing JSFL from windowSWFs is way cooler and more powerful, though you do need to make the interface.Regarding the tools… well, you can tinker with the code for the polystar tool… or check out tools such as SwiffChart from http://www.macromedia.com/software/flash/extensions/There’s definitely room for more tools like polystar though.

  6. ashurbunipal says:

    hey mike and or anybody with the answer,is there anyway to access a wacom tabletwithe jsfl. i am looking to make new toolsthat take advantage of a pressure sensitive tablet.flash takes advantage of it with the brush toolbut how does one access it.thanks

  7. kp says:

    some jsfl files here. cool tools, some commands and effects.www.flashextensibility.com

  8. Hien Nguyen says:

    I am using JSFL to builf a FLA file. I have done some manual steps before use this script to make up FLA file. Whether or not the JSFL allows us to import some data (files) instead of use import function in Flash MX 2004?Any helps, I appreciateHien Nguyen

  9. Johm says:

    I want to ask a question.There is a “FlashDemo.jsfl” created by Flash MX 2004 as follow:///////////////////////////////////////////////var doc=fl.getDocumentDOM();fl.componentsPanel.addItemToDocument({x:100, y:33}, “UI Components”, “Button”);doc.selection[0].name = “MyButton”;//use alert to show the Button’s parametersalert(doc.selection[0].parameters);///////////////////////////////////////////////////In Flash mx2004, create a Flash Document. Then run command with FlashDemo.jsfl.The result of alert is nothing, not as my expected.Then I removed all the controls on this Flash Document and run command with it again,I got the result is “[object, parameter]…”;question: why the result is not the same between the twice?Thk for you help.

  10. Tim Scollick says:

    I’m a big fan of this jsfl stuff. I just got the time to fool around with it today and was shocked at some of the stuff happening (Bit-101!!!). Now I can tell all of our old Director programmers to shut it when they start saying, “Well in Director we would automate…”My only complaint is the lack of good Macromedia documentation on this subject.I’ll probably have most of it figured out by the time that we see any tutorials but can we expect to see a tutorial sometime soon?It is possible to get it all sussed with the DOM that is on LiveDocs but it’s challenging.Slick stuff though. Thanks again Macromedia.Tim

  11. David says:

    Can anyone tell me where the Commands folder is on osX?

  12. brian says:

    actually you can use the prompt, as in javascript prompt, to get dynamic text into your jsfl file. I have used this on a number of commands and it works beautifully.

  13. Deepak Joshi says:

    hi alli can run “jsfl” files uing;flash.exe command.jsflbut can i pass a parameter to jsfl file in command-prompt and how?