Skip to content

Instantly share code, notes, and snippets.

@1024jp
Last active October 1, 2015 12:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 1024jp/1996042 to your computer and use it in GitHub Desktop.
Save 1024jp/1996042 to your computer and use it in GitHub Desktop.
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