Skip to content

Instantly share code, notes, and snippets.

@shurain
Forked from anonymous/gist:7e6006cfba224e10933b
Last active August 29, 2015 14:16
Show Gist options
  • Save shurain/66f93ae800b76089b221 to your computer and use it in GitHub Desktop.
Save shurain/66f93ae800b76089b221 to your computer and use it in GitHub Desktop.
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
tell application "Google Chrome"
set theName to name of active tab of front window
set theURL to URL of active tab of front window
set theURL to my replace_chars(theURL, "%", "%%%")
return "[ %| ](" & theURL & ")"
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment