« `display dialog` crashes Mail.app *or* How to log messages to the Console from Applescript[How to] Your own title bar buttons »

[Snippet] Upload using Transmit

Very simple snippet to send a list of files to a server using Transmit.

Parameters:

Snippet:

on uploadViaTransmit(favoriteName, filesToUpload, location)
    tell application "Transmit"
        set SuppressAppleScriptAlerts to true
        set doc to make new document at end
        tell current session of doc
            with timeout of 60 * 60 seconds
                if (connect to favorite with name favoriteName) then
                    set their stuff to location
                    repeat with f in filesToUpload
                        upload item f with resume mode replace
                    end repeat
                    disconnect
                end if
            end timeout
        end tell
        close doc
    end tell
end uploadViaTransmit

Leave a Reply