Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7077069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:22:38+00:00 2026-05-28T06:22:38+00:00

When running the following script: on run tell application Safari set allWins to every

  • 0

When running the following script:

on run
  tell application "Safari"
    set allWins to every window
    set allTabs to {}
    repeat with currWin in allWins
      set allTabs to allTabs & every tab of currWin
    end repeat
    repeat with currTab in allTabs
      try
        if ((characters -10 thru -1 of (title of currTab as string)) as string) = "Google Music" then set musicTab to currTab
      end try
    end repeat
    tell musicTab
        execute javascript "SJBpost(\"playPause\");"
    end tell
  end tell
end run

received is the syntax Error Expected end of line but found identifier. and javascript becomes highlighted.

I’m using automator and trying to create hot keys for google music following this article.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:22:38+00:00Added an answer on May 28, 2026 at 6:22 am

    You may want to read the linked article a little more closely:

    If you’re using Safari, change the ‘Google Chrome’ in the first line to ‘Safari,’ change the word title (near the middle) to name, and change the word execute on the third-to-last line to do.

    Hence try replacing:

    tell musicTab
        execute javascript "SJBpost(\"playPause\");"
    

    with:

    tell musicTab to do javascript "SJBpost('playPause');"
    

    You also haven’t followed the second instruction of that paragraph change the word title (near the middle) to name. With all those changes, it becomes:

    on run
      tell application "Safari"
                        ^^^^^^
        set allWins to every window
        set allTabs to {}
        repeat with currWin in allWins
          set allTabs to allTabs & every tab of currWin
        end repeat
        repeat with currTab in allTabs
          try
            if ((characters -12 thru -1 of (name of currTab as string)) as string) = "Google Music" then set musicTab to currTab
                            ^^^             ^^^^                                      ^^^^^^^^^^^^
          end try
        end repeat
        tell musicTab to do javascript "SJBpost('playPause');"
                         ^^
      end tell
    end run
    

    Remove the three lines containing ^^^ character markers, they’re just there to make it as obvious as possible.

    And, according to Kurt Rudolph, it’s now called Google Music (no longer in Beta) so we’ve changed the tab title detection as well, to match.

    You’ll have to test this yourself unfortunately since all I see is:

    We're sorry. Google Music is currently only available in the United States
    

    Presumably where the RIAA would have less trouble dragging me into court 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get a PHP script to run every 30 minutes on my
I am running the following script on a cronjob... cd /etc/parselog/ php run_all.php >/dev/null
How can you run the following script in generating docs by PHPdoc? #1 sudo
I am running following test bash script: test.sh ======== pass=$1 if [ $pass -eq
I'm running the following test Java script from the Android HttpURLConnection docs : URL
I am using Azure Management Cmdlets version 1.0. I run the following PowerShell script
I am running Apache on my localhost. From a PHP script run as www-user
I'm running the following VBS script in Windows XP, french version, localised for Switzerland.
I am running following PHP code to interact with a MS Access database. $odbc_con
Running the following vbscript to call svnadmin dump fails (i.e. no dump is being

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.