Very simple snippet to send a list of files to a server using Transmit.
Parameters:
favoriteName- [String] Name of a Transmit favorite. This snippet only does favorites.filesToUpload- [List] A list of all the files that you want to go to a particular place on the server.location- [String] The path that you want the files to be at. Since each upload is a new session, this tends to be relative to the root directory.
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