aapl.crox

Q: How to open a URL without launching a new safari tab?

I would like to write a script (applescript or shell script) to open a url such as this one https://itunes.apple.com/ca/station/beats-1/idra.978194965 which then launches iTunes and play a radio station.

The problem is that all the commands I found will first open a safari tab and then redirect to iTunes for the playback.

Is there a way to not have an empty safari left over from launching this url?

Posted on Jun 12, 2016 3:58 PM

Close

Q: How to open a URL without launching a new safari tab?

  • All replies
  • Helpful answers

  • by leroydouglas,

    leroydouglas leroydouglas Jun 12, 2016 6:09 PM in response to aapl.crox
    Level 7 (22,866 points)
    Notebooks
    Jun 12, 2016 6:09 PM in response to aapl.crox

    You can create a Apple script to close the Safari current tab. Here is a start:

     

    if application "Safari" is running then

        tell application "Safari"

            if front window exists then

                close current tab of front window without saving

            end if

        end tell

    end if