Applescript "end of line" error

Hey there. I’m trying to control Spotify with a bit of AppleScript, just to play/pause.

My script works in the apple Strip Editor, but nothing outputs from Bome. I get an error,

OUT 2.0 ERROR executing AppleScript: action_2_1(): error -2741: Expected end of line but found identifier.

Bome has full disk access and the script works like a charm from Script editor, and has worked from Bome last week.

Any thoughts?

Hi and welcome to the Bome community!

I’d have to look at the project file with the AppleScript and I could probably figure it out. Maybe it is a character set issue. Maybe paste the AppleScript into a text editor first then copy and paste it from your text editor into MT Pro.

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz
1 Like

Hey Steve! Thanks for the swift response!

I tried your suggestion, to the same result. Again, it has worked from Bome before, using both the ‘test’ button, as well as firing it from the intended source, via MIDI note. Also it works directly from AppleScript Editor. Here’s the script I’m working with:

using terms from application ‘Spotify’
if player state of application ‘Spotify’ is paused then
tell application ‘Spotify’ to play
else
tell application ‘Spotify’ to pause
end if
end using terms from

Thanks much!
Chris Holbrook

So, I found a simpler version of the Script function I’m trying to achieve:

tell application ‘Spotify’
playpause
end tell

This works in AppleScript Editor. It did not work in my main project, but I opened a new project and it worked from there. Not sure what the deal is with the main project. Other functions work through there, but not AppleScript.

OK, I think I figured out the culprit. I had created another preset that was to run a different AppleScript, but the script was not finished, and therefore not executable.

I think I read in a forum somewhere that if there is another AppleScript that has issues, it will prevent others from running correctly? I deleted the unfinished script from the other preset and the Spotify script began working again.

Thank you for you time, and good luck with the rest of this!

Blessings,
Chris Holbrook

Hi Chris,

Sorry for the delay but I’m glad you figured it out while waiting.

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz