by
0
4
4,728
2
Top 1% !
Popular
Famous
Refined
Popularity: 1811st place
Created
Modified Jun 20, 2014

Published on:

No tags for this snippet yet.
BrowserChrome
BrowserFirefox
BrowserSafari
LanguageAppleScript
LicenseMIT_X11
SourceGitHub

AppleScript to get url from Safari, Firefox and Chrome

AppleScript to get url from Safari, Firefox and Chrome: 
get_url
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/69440/AppleScript-to-get-url-from-Safari--Fire?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
display dialog "Name of the browser?" default answer "Safari" set inp to text returned of result tell application "System Events" if inp is "Google Chrome" then tell application "Google Chrome" to return URL of active tab of front window else if inp is "Safari" then tell application "Safari" to return URL of front document else if inp is "Firefox" then tell application "Firefox" to activate tell application "System Events" keystroke "l" using command down keystroke "c" using command down end tell delay 0.5 return the clipboard else return end if end tell
If you want to be updated about similar snippets, Sign in and follow our Channels