Skip to content

Instantly share code, notes, and snippets.

@genehack
Created November 5, 2012 05:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save genehack/4015550 to your computer and use it in GitHub Desktop.
Save genehack/4015550 to your computer and use it in GitHub Desktop.
Applescript and shell code for Skotch.app
on check_file(filename)
tell application "Finder"
if exists filename then
return "yes"
else
return "no"
end if
end tell
end check_file
on open filelist
set home to system attribute "HOME"
set scriptname to home & "/.skotch"
set flag to check_file(POSIX file scriptname)
if flag is "no" then
display dialog "ERROR: File " & POSIX path of scriptname & " does not exist"
else
repeat with i in filelist
set filename to quoted form of POSIX path of i
set the clipboard to (do shell script scriptname & " " & filename)
end repeat
end if
end open
#! /bin/sh
PATH=/opt/perl/bin:$PATH \
NOPASTE_SSH_SERVER=genehack.org \
NOPASTE_SSH_DOCROOT=/var/www/paste.genehack.org/ \
NOPASTE_SSH_WEBPATH=http://paste.genehack.org \
NOPASTE_SSH_MODE=0644 \
/opt/perl/bin/nopaste -s ssh "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment