Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save jw-miaem/68a3454b2d16dc111e2cb47d399022bf to your computer and use it in GitHub Desktop.

Select an option

Save jw-miaem/68a3454b2d16dc111e2cb47d399022bf to your computer and use it in GitHub Desktop.
on searchReplace(theText, SearchString, ReplaceString)
set OldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to SearchString
set newText to text items of theText
set AppleScript's text item delimiters to ReplaceString
set newText to newText as text
set AppleScript's text item delimiters to OldDelims
return newText
end searchReplace
on run {input, parameters}
set myClip to the input
set mytext to searchReplace(myClip, "<", "")
set mytext to searchReplace(mytext, ">.", "")
set mytext to searchReplace(mytext, ">", "")
set findIt to "\\"
set replaceIt to "/"
set mylocation to searchReplace(mytext, findIt, replaceIt)
set mylocation to "smb:" & mylocation
tell application "Finder"
open location mylocation
end tell
return input
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment