Wowow. Who said there wasn't a Santa Claus? Well, maybe there isn't a Claus,
but now, we don't need one. This is just what I wanted and in the right
size, too.
Thanks, Drew.
Jan
On 12/3/06, andrew michael baron <andrew@...> wrote:
>
> Just in case anyone is interested, here is the bulk of an apple
> script that we just started using to auto-upload all our files each day.
>
> After the master file is complete, and the rendering is engaged, the
> script waits for the files to complete rendering, and then ftp's all
> the files to the right directories.
>
> This ends up saving us about 2hrs of waiting around for renders to
> complete before uploading and an extra 15min or so of saved time
> manually uploading all the files to the various directories.
>
> Once complete, it sends us an email to let me know.
>
> ********************************************************************
> -- Folder RB_Script exists on Desktop
> -- 1) A folder called RB_Script
> set baseDirectory to "" -- Directory within "web" where all files
> will be placed
> set directoryList to {"images", "video", "video/hd", ""} -- Sub-
> directories within the baseDirectory where files go, referrenced in
> script by number
> set secondDirectoryPlace to "" -- Initializes variable
> set sizeDelay to 30 -- Time script waits to see if files are finished
> writing. Turn up if partial files get uploaded, down if script takes
> too long to execute.
> set exportFolder to "RB_EXPORT" -- Name of folder on desktop where
> files to be uploaded are held
> set uploadFolder to "RB_UPLOADED" -- Name of folder on desktop where
> files are moved after being uploaded
> set timenow to (current date)
> set noteSubject to "Files Uploaded" -- Subject line of notification e-
> mail
> set noteRecipient to "rocketboom@...<rocketboom%40rocketboom.com>"
> -- Who gets
> notification e-mail
> set notice to "RocketLauncher Script Was Run at " & timenow & "
>
> " -- First line of text of notification e-mail
> set didSomethingFlag to 0 -- Sets a flag to see if the script did
> anything, just to avoid generating empty e-mails.
>
> tell application "Finder"
> with timeout of 3600 seconds
> repeat while the (count of items in folder exportFolder) is not 0
> set bunch to every file of folder exportFolder in desktop
> repeat with thingus in bunch
> set didSomethingFlag to didSomethingFlag + 1
> set thingusSize to size of thingus
> if thingusSize > 2000 then
> delay sizeDelay
> set thingusNewSize to size of thingus
> if thingusSize = thingusNewSize then
> set thingusName to name of thingus
> if thingusName contains "sm.jpg" then
> set directoryPlace to baseDirectory & item 1 of directoryList
> else if thingusName contains ".jpg" then
> set directoryPlace to baseDirectory & item 1 of directoryList
> set secondDirectoryPlace to baseDirectory & item 3 of
> directoryList
> else if thingusName contains "hd.mov" then
> set directoryPlace to baseDirectory & item 3 of directoryList
> else if thingusName contains ".mov" then
> set directoryPlace to baseDirectory & item 2 of directoryList
> else if thingusName contains "full.wmv" then
> set directoryPlace to baseDirectory & item 2 of directoryList
> else if thingusName contains ".wmv" then
> set directoryPlace to baseDirectory & item 2 of directoryList
> else if thingusName contains ".mp4" then
> set directoryPlace to baseDirectory & item 2 of directoryList
> else if thingusName contains ".mpg" then
> set directoryPlace to baseDirectory & item 2 of directoryList
> else if thingusName contains ".3gp" then
> set directoryPlace to baseDirectory & item 2 of directoryList
> else
> set directoryPlace to baseDirectory & item 4 of directoryList
> end if
> do shell script "~/Desktop/RB_Script/send.ex " & thingusName &
> " " & directoryPlace
> set notice to notice & (current date) & thingusName & " was
> uploaded to " & directoryPlace & "
> "
> if secondDirectoryPlace is not "" then
> do shell script "~/Desktop/RB_Script/send.ex " & thingusName &
> " " & secondDirectoryPlace
> set notice to notice & (current date) & thingusName & " was
> moved to " & secondDirectoryPlace & "
> "
> set secondDirectoryPlace to ""
> end if
> move thingus to folder uploadFolder in desktop
> end if
> end if
> end repeat
> end repeat
> end timeout
> end tell
>
> set notice to notice & "
>
> Have a nice day."
>
> tell application "Mail"
> launch
> set this_message to make new outgoing message with properties
> {subject:noteSubject, content:(notice)}
> tell this_message
> make new to recipient at end of to recipients with properties
> {address:noteRecipient}
> send
> end tell
>
> end tell
> ********************************************************
>
>
--
The Faux Press - better than real
http://fauxpress.blogspot.com
[Non-text portions of this message have been removed]