Type in your question below and we'll check to see what answers we can find...
Loading article...
Submitting...
If you couldn't find any answers in the previous step then we need to post your question in the community and wait for someone to respond. You'll be notified when that happens.
Simply add some detail to your question and refine the title if needed, choose the relevant category, then post.
Before we can post your question we need you to quickly make an account (or sign in if you already have one).
Don't worry - it's quick and painless! Just click below, and once you're logged in we'll bring you right back here and post your question. We'll remember what you've already typed in so you won't have to do it again.
Device
MacBook Pro 16-inch 2021
Operating System
macOS Ventura 13.2.1 (22D68)
My Question or Issue
AppleScript seems completely broken. I can't even load the dictionary in AppleScript Editor, and this basic script doesn't work:
tell application "Spotify"
play
end tell
I get:
error "The variable play is not defined." number -2753 from "play"
Solved! Go to Solution.
So open dictionary didn't work. I could choose Open Dictionary, select Spotify, then click Choose, and literally nothing would happen (other than the window closing). The dictionary for Spotify would NOT pop up.
Your alternate script didn't work either.
But then I dug in and found the underlying AppleScript definition file in Spotify, and strangely the simple act of directly opening it in Script Editor fixed it?!? I did the following:
That opened the dictionary, and then everything worked after that. It seems like my computer somehow is failing to load the Spotify script definitions, but once I force it, it works?
To do it quicker, you could also do this from Terminal:
open -a /System/Applications/Utilities/Script\ Editor.app /Applications/Spotify.app/Contents/Resources/Spotify.sdef
So I have a workaround now, but I still have no idea what the root cause is, or even whether it's Spotify's fault or macOS's fault, or something else.
Paw-some to see you ToastyKen!
I'm sorry to hear that you're having trouble with AppleScript.
Regarding the issue you mentioned, the error message you're receiving suggests that the "play" command is not recognized by the Spotify application, and therefore cannot be executed by AppleScript.
One possible solution is to check the Spotify dictionary to see if the "play" command is available. To do this:
If the "play" command is not available in the dictionary, you may need to use a different command or approach to achieve the desired functionality.
Also if the "play" command is available, you can try modifying your script to explicitly reference the application's dictionary by using the "using terms from" block. For example:
using terms from application "Spotify"
play
end using terms from
This should ensure that the "play" command is recognized by the Spotify application when the script is executed.
I hope this helps! Just a pup-date on your situation will do, thanks!
-Prague the Dog
So open dictionary didn't work. I could choose Open Dictionary, select Spotify, then click Choose, and literally nothing would happen (other than the window closing). The dictionary for Spotify would NOT pop up.
Your alternate script didn't work either.
But then I dug in and found the underlying AppleScript definition file in Spotify, and strangely the simple act of directly opening it in Script Editor fixed it?!? I did the following:
That opened the dictionary, and then everything worked after that. It seems like my computer somehow is failing to load the Spotify script definitions, but once I force it, it works?
To do it quicker, you could also do this from Terminal:
open -a /System/Applications/Utilities/Script\ Editor.app /Applications/Spotify.app/Contents/Resources/Spotify.sdef
So I have a workaround now, but I still have no idea what the root cause is, or even whether it's Spotify's fault or macOS's fault, or something else.
Hey there you, Yeah, you! 😁 Welcome - we're glad you joined the Spotify Community! While you here, let's have a fun game and get…