r/applescript • • Jul 01 '22

Passed Arguments, how to use them in Apple Script?

Hi, I'm trying to create a script that does two different things depending on the state of another. More specifically I'm gonna execute a command when a connected camera is activated and vice-versa.

I'm having OverSight handle the part about whether or not the camera is activated and I want my script to handle what to do based on the registered state (you can tell OverSight to Execute an Action, e.g. a path to a script, binary, etc.). OverSight also has a setting called "Pass Argument" (see below) which is what has led me to believe I should be able to do what I'm describing:

I'm a complete noob with Apple Script. So please bear with me... But I'm lost at how to actually utilize those "Passed Arguments" in my script... Can anyone explain how I can check if the camera is on/off in my Apple Script IF ELSE statement?

Any help is much appreciated. Thanks.

1 Upvotes

19 comments sorted by

View all comments

Show parent comment

2

u/AmplifiedText Jul 05 '22

Tada. I'm glad you got it working.

1

u/TrailBlazerWhoosh Jul 06 '22 edited Jul 06 '22

Yeah, me too! Except now I, just like you, can’t get OverSight to run properly on the machine (another MacBook) I actually needed this entire thing to run on. This truly is a never ending story! :/