Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
upload current document on CotEditor with Transmit
(*
Upload on Transmit
[description]
Upload current document on CotEditor via Transmit.
Required to enable DockSend service on Transmit.
[version] 1.1
[release] 2012-03-07
[lastmod] 2014-12-02
[author] 1024jp <http://wolfrosch.com/>
[licence] Creative Commons Attribution 4.0 International License
*)
-- __setting_______________________________________________________________
-- Shows dialog if the document wasn't saved?
property showAlertDialog : true
-- __main_______________________________________________________________
-- get file path from CotEditor
tell application "CotEditor"
if not (exists front document) then return
set theFile to file of front document
end tell
-- end script if no file path is specified
if theFile is missing value then
if showAlertDialog then
beep
display alert "No file path is specified." message "Please save the file first." as warning
return
end if
return
end if
-- give the file to Transmit
tell application "Transmit" to open theFile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment