Skip to content

Instantly share code, notes, and snippets.

Created March 6, 2015 07:34
Show Gist options
  • Save anonymous/7e6006cfba224e10933b to your computer and use it in GitHub Desktop.
Save anonymous/7e6006cfba224e10933b 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
@beomjunshin-ben
Copy link

return "[ %| ](" & theURL & ")" =>
return "[" & theName & "](" & theURL & ")"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment