Upload files to active Transmit 4 favorite

Sharing and discussing custom actions for LaunchBar
Post Reply
Rank 1
Rank 1
Posts: 21
Joined: Fri Jan 22, 2010 2:57 am

Upload files to active Transmit 4 favorite

Post by Cottser » Tue Nov 22, 2011 9:53 pm

You'll need to be connected to a favorite, as opposed to an "ad hoc" connection in Transmit for this to work.

The other important note is that this script will ignore your settings for "When an item already exists…" in Preferences > Transfers. The script will always overwrite the remote file(s) without prompting. Make sure you're uploading the right file(s) to the right place, in other words. This behaviour can be changed by removing the words "with resume mode overwrite" from the script to use your Transmit settings.

Install this script somewhere that LaunchBar can see it and refresh your index.

In LaunchBar, select the file(s) you want to upload, hit tab and select this script. Your files will be uploaded to the currently selected folder in Transmit.

I haven't tested this extensively, but it seems to play nicely with multiple tabs/windows in Transmit as well - it should upload to the frontmost tab/window. Have fun!

Code: Select all

on open (theFiles)
   repeat with theFile in theFiles
      set localFile to (POSIX path of theFile)
      my transmitUpload(localFile)
   end repeat
end open

on transmitUpload(localFile)
   tell application "Transmit"
      set theBrowser to remote browser of current tab of document 1
      set remotePath to root path of theBrowser
      tell theBrowser
         upload item at path localFile to remotePath with resume mode overwrite
      end tell
   end tell
end transmitUpload

Post Reply