# Applescript "end of line" error

**URL:** <https://forum.bome.com/t/applescript-end-of-line-error/4585>\
**Category:** Bome Products\
**Tags:** applescript\
**Created:** [October 3, 2022, 9:22pm UTC](https://forum.bome.com/t/applescript-end-of-line-error/4585 "2022-10-03T21:22:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kkxworship](https://forum.bome.com/letter_avatar_proxy/v4/letter/k/a6a055/32.png) [@kkxworship](https://forum.bome.com/u/kkxworship)\
**Post date:** [October 3, 2022, 9:22pm UTC](https://forum.bome.com/t/applescript-end-of-line-error/4585/1 "2022-10-03T21:22:40Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![SteveC](https://forum.bome.com/user_avatar/forum.bome.com/stevec/32/8250_2.png) [@SteveC](https://forum.bome.com/u/SteveC)\
**Post date:** [October 3, 2022, 10:10pm UTC](https://forum.bome.com/t/applescript-end-of-line-error/4585/2 "2022-10-03T22:10:57Z")

</div>

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_

---

<div class="post-metadata">

**Author:** ![kkxworship](https://forum.bome.com/letter_avatar_proxy/v4/letter/k/a6a055/32.png) [@kkxworship](https://forum.bome.com/u/kkxworship)\
**Post date:** [October 4, 2022, 6:14pm UTC](https://forum.bome.com/t/applescript-end-of-line-error/4585/3 "2022-10-04T18:14:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![kkxworship](https://forum.bome.com/letter_avatar_proxy/v4/letter/k/a6a055/32.png) [@kkxworship](https://forum.bome.com/u/kkxworship)\
**Post date:** [October 5, 2022, 2:40pm UTC](https://forum.bome.com/t/applescript-end-of-line-error/4585/4 "2022-10-05T14:40:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kkxworship](https://forum.bome.com/letter_avatar_proxy/v4/letter/k/a6a055/32.png) [@kkxworship](https://forum.bome.com/u/kkxworship)\
**Post date:** [October 5, 2022, 3:00pm UTC](https://forum.bome.com/t/applescript-end-of-line-error/4585/5 "2022-10-05T15:00:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![SteveC](https://forum.bome.com/user_avatar/forum.bome.com/stevec/32/8250_2.png) [@SteveC](https://forum.bome.com/u/SteveC)\
**Post date:** [October 5, 2022, 3:20pm UTC](https://forum.bome.com/t/applescript-end-of-line-error/4585/6 "2022-10-05T15:20:08Z")

</div>

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_
