Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (*
- Skift selv ud hvis i bruger andet end Safari
- # Google Chrome
- tell application "Google Chrome" to return URL of active tab of front window
- tell application "Google Chrome" to return title of active tab of front window
- # Google Chrome Canary
- tell application "Google Chrome Canary" to return URL of active tab of front window
- tell application "Google Chrome Canary" to return title of active tab of front window
- # Chromium
- tell application "Chromium" to return URL of active tab of front window
- tell application "Chromium" to return title of active tab of front window
- # Safari
- tell application "Safari" to return URL of front document
- tell application "Safari" to return name of front document
- # Webkit
- tell application "Webkit" to return URL of front document
- tell application "Webkit" to return name of front document
- https://gist.github.com/vitorgalvao/5392178#file-get_title_and_url-applescript
- *)
- tell application "Safari"
- set theURL to URL of front document
- set theTitle to get name of document 1
- set selectedText to (do JavaScript "(''+getSelection())" in document 1)
- if selectedText = "" then
- set citat to ""
- else
- set citat to "[citat]" & selectedText & "[/citat]" & return
- end if
- set the clipboard to citat & "[link=" & theURL & "]" & theTitle & "[/link]" as string
- end tell
Advertisement
Add Comment
Please, Sign In to add comment