git.fiddlerwoaroof.com
scripts/emacsclient.applescript
1c6efcd6
 #!/usr/bin/osascript
 on run argv
   set currentApp to my getCurrentApp()
9dc16eeb
   do shell script "/usr/local/bin/emacsclient -c '" & (item 1 of argv) & "'"
eb65d556
   do shell script "open '/Volumes/" & currentApp & "'"
1c6efcd6
 end run
 
 to getCurrentApp()
eb65d556
   return replace_chars((path to frontmost application as text), ":", "/")
1c6efcd6
 end getCurrentApp
eb65d556
 
 on replace_chars(this_text, search_string, replacement_string)
  set AppleScript's text item delimiters to the search_string
  set the item_list to every text item of this_text
  set AppleScript's text item delimiters to the replacement_string
  set this_text to the item_list as string
  set AppleScript's text item delimiters to ""
  return this_text
 end replace_chars