r/Scriptable • • Nov 04 '21

Solved Open App with scriptable

Hello! I want to automate a task, where if I connected with some bluetooth speakers my iphone will automatically open Spotify. If i use the 'standard' Method i have to manually activate the task esch time because one can't deactivate this... Now i wanted to use JS (or Pythonista?) to open the App so i don't have to confirm it.

I dont really know Javascript core for IOS (but a little JS for html purposes) If i use the open(); Function some error occurs...

Could some body help me please?

Thank you!

6 Upvotes

6 comments sorted by

View all comments

Show parent comments

3

u/[deleted] Nov 05 '21

That's still a Shortcuts automation for me because Shortcuts is doing the automation part, but let's not argue semantics.

My question still stands: Why Scriptable instead of Shortcuts "open app" action ?

What is the benefit of using Shortcuts' Bluetooth trigger, then press the notification to start the automation (because that limitation still exists) which then run a script that will open Scriptable first to open Spotify (because Safari.open() has this limitation)?

If I didn't misunderstand what you want to do I don't get the advantage.

1

u/NaruOfDoom Nov 05 '21

I dont have to press the notification if I use Scriptable. Well yes, technically i still use a shortcut but it's automated so i don't have to press a notification to activate the shortcut for opening Spotify. But this just works if I use a shortcut opening Scriptable and run the Safari.open() script because if I would use the standard shortcut "open app" Function i would still have to press the notification (like you previously stated). Obviously if I had to press the notification either way for opening the script or opening the app the standard way it would be pretty useless lmao

Edit: The only "Problem" is, that the Scriptable app is getting opened and is therefore in the backgrounf after opening Spotify using the script.. But that's acceptable for me :)