Applescripting Flash...

Would it be possible to automate importing Ai files into a Flash Library and also setting the linkage names via properties menu by using applescript? I have a very mundane set of tasks in front of me and it involves just that. I need to import massive amounts of Illustrator artwork into my Flash Library and then set linkage names to the file name. Does anyone have any tips that might get me started??

thanks,

~nate

This was a long time ago, but does anyone have any ideas? I’m still battling this one. I read an article by Bill Cheeseman on GUI scripting unscriptable applications. Would this be a candidate?

Thanks,

N

Okay so I started with some GUI scripting and got a good result. However, I need to take this a little further and maybe someone can give me a hand. Here’s what I have so far:

on do_menu(app_name, menu_name, menu_item)
	try
		-- bring the target application to the front
		tell application app_name
			activate
		end tell
		tell application "System Events"
			tell process app_name
				tell menu bar 1
					tell menu bar item menu_name
						tell menu menu_name
							click menu item menu_item
							--Trying to get Flash File Type?
							tell tab group "Type:" of window "New Documents"
								select "Flash File (ActionScript 2.0)"
								keystroke return
							end tell
						end tell
					end tell
				end tell
			end tell
		end tell
		return true
	on error error_message
		
		return false
	end try
end do_menu
do_menu("Adobe Flash CS3", "File", "New...")


on do_submenu(app_name, menu_name, menu_item, submenu_item)
	try
		-- bring the target application to the front
		tell application app_name
			activate
		end tell
		tell application "System Events"
			tell process app_name
				tell menu bar 1
					tell menu bar item menu_name
						tell menu menu_name
							tell menu item menu_item
								tell menu menu_item
									click menu item submenu_item
									delay 5
									keystroke return
									delay 5
									repeat 10 times
										delay 5
										keystroke return
									end repeat
									
								end tell
							end tell
						end tell
					end tell
				end tell
			end tell
		end tell
		return true
	on error error_message
		return false
	end try
end do_submenu

do_submenu("Adobe Flash CS3", "File", "Import", "Import to Library...")


This works well IF you know how many art files to import so the script has to be edited each time to account for 20, 47, 353 art files for example. Next I would like to link the art in the Flash Library and set a naming convention. Also by the comment: --Trying to get Flash File Type?, I cant seem to select the initial Flash Document. I want to select an Actionscript 2.0 flash file. If anyone speaks Flash out there, let me know.

thanks,

Nate

I tried to create new file, but it is not working for me. I have changed the code for CS4.

In event log I am getting this description:

Regards,
Poo