Forked from technosophos/firefox-open-tab.applescript
Created
January 6, 2018 17:39
-
-
Save rimusz/53212cfe8d867883a62e1ae7c0bb23bb to your computer and use it in GitHub Desktop.
Open a Tab in Firefox on macOS with AppleScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To run: | |
# osascript firefox-open-tab.applescript http://technosophos.com | |
# | |
# References: | |
# https://support.mozilla.org/en-US/questions/1130718 | |
# https://stackoverflow.com/questions/3645763/how-do-i-instruct-applescript-to-open-a-new-firefox-window-with-a-link | |
on firefoxRunning() | |
tell application "System Events" to (name of processes) contains "firefox" | |
end firefoxRunning | |
on run argv | |
if (firefoxRunning() = false) then | |
do shell script "open -a Firefox " & (item 1 of argv) | |
else | |
tell application "Firefox" | |
activate | |
open location item 1 of argv | |
end tell | |
end if | |
end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment