Page 1 of 1

Help with a System Volume Command

PostPosted: Sat Nov 02, 2019 4:24 pm
by makedrinklas
Ok, so here is the big problem. Much of our Indigo functionality comes from Applescripts controlling the system audio, from motion alerts to waking up in the Am. Worse yet, the house is under major construction hence the Indigo mac is in the basement on a saw horse! It has the headphone out running to an amp and speakers placed throughout.

Can someone please be kind and tell me how to accomplish this as an embedded python script? Also, will I need to compile and run? I have many variations of this, some actions just change the house volume depending on the time of day. This one has been how we wake up for years...

Code: Select all
# tell application "Finder"
#    set volume 4
# end tell
# tell application "iTunes"
#    set sound volume to 50
#    play user playlist "iTunes WAMU"
# end tell

I am reading that Python is very easy and simple, and searching to see if this has been answered. It looks like someone else asked and did not receive a response. Hoping this is different, I am pressed for time to learn scripting, especially while sitting on a footstool under a bare bulb!

Re: Help with a System Volume Command

PostPosted: Sat Nov 02, 2019 9:58 pm
by RogueProeliator
Ok, so here is the big problem. Much of our Indigo functionality comes from Applescripts controlling the system audio, from motion alerts to waking up in the Am. Worse yet, the house is under major construction hence the Indigo mac is in the basement on a saw horse! It has the headphone out running to an amp and speakers placed throughout.

Is it safe to assume that your desire to migrate off the embedded AppleScripts is based upon the Indigo 7.4 change to drop support for them? If so, you might consider this option if you have a ton of them -- anything that does not reference the Indigo Server (i.e. is not referencing Indigo, such as not reading/setting variables, etc.) can continue to work as an AppleScript called from Indigo -- it just has to be in an external file.

Then you could concentrate on changing those that HAVE to be changed because they reference Indigo. It wouldn't hurt to ultimately get off AppleScript, but this might be an opportunity to spread out your changes/urgency a bit.

Adam

Re: Help with a System Volume Command

PostPosted: Sun Nov 03, 2019 11:19 am
by makedrinklas
Huh. Yeah they are all simple finder commands to adjust volume and activate iTunes at various volumes on a schedule. A rudimentary but reliable alarm clock, gradually increasing volume is nice routine to wake up to.

Great, so I just save the various specific Applescripts into text files and away we go...

Thanks, I’ll give it a try!

Re: Help with a System Volume Command

PostPosted: Sun Nov 03, 2019 11:40 am
by matt (support)
makedrinklas wrote:
Great, so I just save the various specific Applescripts into text files and away we go...

Open Apple's Script Editor app and copy/paste the embedded scripts into new files there, then save those script files out to then be referenced by your Indigo Actions. That is, you want Script Editor (AppleScript) files and not just simple text files.

Re: Help with a System Volume Command

PostPosted: Sun Nov 03, 2019 9:26 pm
by makedrinklas
Okay! I will give that a try when I get a bit of free time next weekend. Its pretty rough out here. Thanks Matt.

Re: Help with a System Volume Command

PostPosted: Sun Jan 05, 2020 5:11 pm
by makedrinklas
Thanks Matt, this is all now working again. Took, me a while to get around to it, but that was a simple solution.

BTW, do you know of any way to search, identify or otherwise highlight action groups that contain remaining embedded applescripts? (In case I've missed any.)

Best,

Mike

Re: Help with a System Volume Command

PostPosted: Sun Jan 05, 2020 6:20 pm
by matt (support)
Hi Mike,

In Indigo 7.4 you can choose the Help->Show AppleScript Usage in Event Log menu item to have the locations of embedded AppleScripts written to the Event Log window.

Re: Help with a System Volume Command

PostPosted: Sat Mar 23, 2024 1:10 pm
by makedrinklas
Hey Matt, nothing actionable –  just an FYI update on this, my Indigo Actions that call on outside Applescripts have all somehow become disconnected in the 2023.2 update. Maybe this was expected in the update notes and I missed it.

It did ask me for permission at one point on an iTunes Off action pointing to a script but all of the 10 volume actions were set to "none".

Basically I still l use them to set the home volume (I have wired computer speakers around the house plugged into the Mac via a Sound Blaster Play! 3). At night volume 4 on outside motion alerts will throw you out of bed! (Actually my wife tosses me out.). Also an abrupt way to wake up to the good morning–time announcement in the AM as our alarm. I then reset back to the default 4 during the rest of the day.

I still use iTunes remote and this is a good way to control the same sound volume output.

I am re-selecting the scripts now.

Re: Help with a System Volume Command

PostPosted: Sun Mar 24, 2024 12:19 pm
by jay (support)
Were those embedded AppleScripts or were the executing AppleScript files?

Re: Help with a System Volume Command

PostPosted: Mon Mar 25, 2024 9:40 am
by makedrinklas
They were executing script files. Not sure how all ten happened, they had to be reconnected manually.

All is well now, just an FYI.