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.

Revisions

  1. @invalid-email-address Anonymous created this gist Mar 27, 2012.
    27 changes: 27 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    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