UI scripting/System Events howto ?

Hello averyone

I am a newbie with applescript, and I’m trying to make some ACGI scripts for my work.
So this is what it is about :

I developped a site to create driving test DVD’s with some over people around France, which does thes stuff :

  • Some people upload digital pictures onto the site, then sort them with dedicated criterias
  • Some others can write questions from these pictures, and add an audio track
  • Then I can get these questions and make Flash animations onto the JPG files, then upload FLA and SWF back to the main server.

So as I work with Jaguar and Flash MX this is what I want to do :

Browse to the questions that are validated, download the JPEG file → This is ok
Then with an ACGI program I open the JPEG and save it as a .FLA → This is quite done

As Flash MX is not really scriptable (There is an action stuff in the dictionary, but I have no clue what this is about), I use Apple UI scripting beta to control the app, this is not very handy.
I’m able to open the file and save it as a .fla (I use keystroke commands to type the filename in the ‘save as’ dialog, but I didn’t find how to specify the path)

So this is my question :
Is there a way to specify a path in an open/save/import dialog with System events and UI scripting ?

The only idea in my mind is that you install “Default Folder”, assign a favorite for the location you wish save your “.fla”, then use the keystroke DF provides…

Unless you wish navigate throug save-dialog’s UI elements (browsers, and so on). In such case, you may take a look to PreFab’s UI Browser http://www.prefab.com/ and buy some aspirins. :wink:

I found a solution to my problem, but now I have another one.

To save my document to the right place this is what I do :

  • I do a clikc to “save” then I hit keystroke “command-d” which opens my Desktop.
    I save my document the I tell the finder to move it to the right place, and reopen it into Flash.

when i do

keystroke “i”

It makes a “q”.

Is it a bug, or is there another way to type “i” ?

Seems a bug… (GUI scripting is a beta :wink: )
Here, keystroke “i” gives keystroke “a” :cry:

Indeed keystroke “i” makes a “q” for me because I have an azerty kayboard, and makes “a” on a qwerty keyboard for you