JavaScriptCore is a built-in iOS library that enables you to use JavaScript in apps alongside Objective-C and Swift. It lets developers read JavaScript from a string, execute it from Objective-C or Swift, and share data structures and functions across languages. We JavaScriptCore to share code between Web and iOS.
This file contains 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
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 |