Groups | Blog | Home
all groups > flash (macromedia) > january 2007 >

flash (macromedia) : Using OS X to Auto-Upload Flash Publications


malachidj
1/20/2007 10:55:58 PM
John Pattenden
1/21/2007 10:22:22 AM
Take a look at automater it is included in 10.4 and you can use to
create a script that would watch a folder and do something when a file
appears - like upload it.

--
John Pattenden
Screentime Media - Flash Tools since 1997
http://www.screentime.com
malachidj
1/21/2007 10:11:13 PM
Automator is pretty weak, and you can't export Automator workflows as scripts
to attach as folder actions, as far as I know. I guess until we get some
application scripting support in the Adobe Suite we can't use Dreamweaver for
automatic uploads. The rabbit hole goes pretty deep.. terminal and lftp and so
on... Bleh.. Here's an easy, fool proof way I found using Transmit and
Applescript that takes only a minute to set up and seconds to reconfigure.. So
to automatically upload a swf to your server from a flash publish..

? Create a new folder to trigger the upload.
? Set Flash to publish the HTML (or another format you don't need) to the
folder you created.
? Open Transmit, and create a favorite that opens the site and remote
directory of the file you are replacing...
? Set Transmit's File Transfer preferences to automatically replace existing
uploads. (You can probably supress this dialog using script as well?)
?Create a new script using script editor.. Copy paste the following script,
it's an adaption of examples provided at Transmit's support pages
(transmit.com/support) drag and drop the file you wish to upload in place of
the file, and change the nickname of the favorite you created.

on adding folder items to this_folder after receiving these_items
activate application "Transmit"
tell application "Transmit"
make new document at before front document
tell document 1
tell session 1
if (connect to favorite with name "mySite") then
try
upload item "/Users/bsmith/Sites/mySite/my.swf"
end try
else
display dialog ("An error occured, could not connect to favorite")
end if
disconnect
end tell
end tell
end tell
end adding folder items to
malachidj
1/21/2007 10:27:04 PM
oops, we have to delete the contents of the trigger folder, or the folder
action does know when Flash is done with the Publish. Update the end of the
code to look like this:

activate application "Finder"
tell application "Finder"
delete these_items
end tell
end adding folder items to
AddThis Social Bookmark Button