osascript problem

492 views
Skip to first unread message

Kalman Tarr

unread,
Apr 11, 2023, 2:16:17 AM4/11/23
to QLab
Hi members,

I have a problem I've never encountered in the past.
I've got an older MACBOOK air (2017 model). Basically I used High Sierra. But now  I installed a Catalina OS.

The challenge was, control Keynote app with Qlab. 
Simple sets the first dia and starts playing.
I wrote script shown on enclosed pict. But when I run it gives an error message and gest stuck. You can see. "osascript".
I don't know what it is this and especially how can I solve this problem.
The most interesting thing is I have a new M1 MACBOOK air. 
Everything is going well on it.
Any suggestion to solve the above Catalina problem???
Thanks a lot in advance,

Kalman

Screenshot 2023-04-11 at 7.52.35.png

Taylor Glad

unread,
Apr 11, 2023, 3:01:25 AM4/11/23
to QLab
So the script works on your M1 MacBook Air running a recent MacOS, but it doesn't work on your older MacBook Air running Catalina?

I believe Apple introduced more security and privacy settings in Catalina, so you may need to grant permissions. Try following these steps:

  1. Open "System Preferences" on your MacBook Air.
  2. Click on "Security & Privacy."
  3. Navigate to the "Privacy" tab.
  4. Scroll down the list on the left and click on "Accessibility."
  5. Click on the lock icon in the bottom-left corner of the window to make changes. You will need to enter your admin password.
  6. Click the "+" button to add a new application to the list of apps allowed to control the computer.
  7. Navigate to the location of the "osascript" binary, which is usually found in /usr/bin/osascript. To find this folder, press Cmd+Shift+G while in the file selection window, and enter /usr/bin/.
  8. Select "osascript" and click on "Open" to add it to the list.
  9. Make sure the checkbox next to "osascript" is checked.
Then try running the AppleScript command again to see if it runs without any more errors.

Kalman Tarr

unread,
Apr 11, 2023, 3:41:17 AM4/11/23
to QLab
Thanks Talor,
I will try your advice.
But I found a good solution.
Click click click
Click menu bar.

Thanks for your work .....
Kalman

Kalman Tarr

unread,
Apr 11, 2023, 3:48:22 AM4/11/23
to QLab
Hi Taylor,
It works really GOOD!
It solved my problem. Thank you again!
There are two solution in this time. All the two good!

Best,
Kalman

Kalman Tarr

unread,
Apr 22, 2023, 1:07:36 PM4/22/23
to QLab
Hi Taylor,
I have a new question to you. Last time you solved the 'osascript' issue. It was a great help for me.
In this days I have next one. Maybe you know the answer.
I wrote code lines in script cue. It is working good on a Ventura op system. I have an old MAC running on Catalina. I airdroped the file to my old machine. It is not works I can say it doesn't do nothing. I wondering why.
What it is doing? In external program clicks on menu elements. And so it set up the neccessary tools.
I'll Show you the line of codes:
try
tell application "ScreenCaptureSyphon" to activate
tell application "System Events" to tell process "ScreenCaptureSyphon"
tell menu bar item 1 of menu bar 2
click
click menu item "Mouse Cursor" of menu 1
tell first menu item of last menu
keystroke (key code 36) --"enter"
end tell
end tell
end tell
end try

In the first line you can see the name of app I use.
Hopefully my description is understandable.
Where could the issue be? Any suggestion pls.

Sincerely,
Kalman

Taylor Glad

unread,
Apr 22, 2023, 2:07:40 PM4/22/23
to ql...@googlegroups.com
I don't have any Mac with Catalina to test it. What error message does it give you? (You can share it in the original language if that is easier)


--
Contact support anytime: sup...@figure53.com
Follow QLab on Twitter: https://twitter.com/QLabApp
User Group Code of Conduct: https://qlab.app/code-of-conduct/
---
You received this message because you are subscribed to a topic in the Google Groups "QLab" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/qlab/VlcK0ql4xAM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to qlab+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qlab/4172fbb4-af7b-4b39-ace5-32b548e7682fn%40googlegroups.com.

micpool

unread,
Apr 22, 2023, 2:12:19 PM4/22/23
to QLab
It won't give any error messages at the moment as it’s in a try block

Do the standard debugging steps for an AppleScript,

Comment out the try block

—try
— end try

Run the script in script editor with the replies pane open,

Compare what you get on your ventura system with what happens with Catalina.

Mic



Kalman Tarr

unread,
Apr 22, 2023, 3:20:39 PM4/22/23
to ql...@googlegroups.com
Hi guys,
Mic has truth, there is no error message therefore I can't give you anything Taylor. I follow Mic Advise tomorrow and tell you the result.
Thank you two.
Best
Kalman
I am watching snooker wch now 🌐
Tomorrow 

You received this message because you are subscribed to the Google Groups "QLab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qlab+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qlab/702b2522-029b-4821-a51c-f95c55d63e8an%40googlegroups.com.

Kalman Tarr

unread,
Apr 24, 2023, 3:25:39 AM4/24/23
to QLab
Hi Mic and Taylor,
I took your advice Mic.
It generates the next error message:

error "System Events got an error: Can’t get last menu of menu bar item 1 of menu bar 2 of process \"ScreenCaptureSyphon\". Invalid index." number -1719 from last menu of menu bar item 1 of menu bar 2 of process "ScreenCaptureSyphon"

Replacing the word "last" to a 'number', it is not a solution. I tried.


This will help even one of you to rate it?
Best 

micpool

unread,
Apr 24, 2023, 2:17:06 PM4/24/23
to QLab
Hi Kalman,
I think all your difficulties with this script are covered by the general warning about UI scripting, and in particular UI scripting an application that does not have a coherent UI hierarchy that I made in the other thread. i.e UI scripting is generally ghastly, and only worth bothering with if it is going to be a major time saver to utilise it.

As you have found, just because it was working on one Mac OS doesn't mean it will on another.

In this instance I think the clicking at screen locations solution I offered earlier may be more reliable, but I really  think that the time it would take you (and any other users offering help)  to get this working in every circumstance on every recent MacOS from Big Sur, is far more than it would ever take you to set the  parameters manually when you needed to do it.

Best Regards

Mic

Kalman Tarr

unread,
Apr 25, 2023, 4:55:50 AM4/25/23
to QLab
Hi Mic,

I try interpret your words. You know my knowledge is on low level. This time I only heard from you about UI scripting. I try to see what it is at all. It is a big black hole for me at the moments. But the scripting was also the same at the beginnig. (Even now I am not much further inside or deeper into it)

You have to decide whether it's worth investing more work or whether it's enough to wait a few seconds until the expected event happens. (4-5 sec is not too much)
At my level It is enough for me.

The script I wrote is working good on MAC OS Ventura. Using it on a different MAC OS, if the freezing time seems long, the adjustment must be done manually. It's all.

Mic thank you for your attentive help all time.

Best Regards
Kalman

Kalman Tarr

unread,
Apr 25, 2023, 5:15:27 AM4/25/23
to QLab
Nice day Mic,

One more fast question.
You mentined an app which is collects/manages several mono audio to one and only multi channel audio file. I used it on my really old MAC os High Sierra. I have deleted the whole machine and installed the new Catalina. I lost the app.

Tell me
            please
           set theAppname to me 
           the app name
End Tell

THX 

Best,
Kalman

Kalman Tarr

unread,
Apr 25, 2023, 6:17:29 AM4/25/23
to QLab
Hi Mic,
In the meantime I found the app. Sound Files Merger.
I dowloaded and tried to install. There is no result on Ventura. QuestionMark in the middle of icon.
I made a search on Monterey machine but the result is the same. OOPS.
A guess the third party developer doesn't work fast.
Any idea?

Best Regards
Kalman

micpool

unread,
Apr 25, 2023, 6:56:38 AM4/25/23
to QLab
https://www.sounddevices.com/installing-wave-agent-on-mac-os-catalina-and-big-sur/

You may even find that you can install sound files merger the same way, but i havent tried it 

Sam Kusnetz

unread,
Apr 25, 2023, 8:06:27 AM4/25/23
to QLab
We also have a new cookbook chapter which combines audio files using a command line tool called sox:

https://qlab.app/cookbook/multifiler

Enjoy!

Sam

––
Sam Kusnetz [he/him/his] (what is this?)
Figure 53
https://qlab.app | https://figure53.com

micpool

unread,
Apr 25, 2023, 9:49:13 AM4/25/23
to QLab
Update SoundFilesMerger was 32 bit so won't run on any modern operating system
Wave Agent Works fine but the download link is broken in the instructions for installing on Monterey.

Use this link https://www.sounddevices.com/firmware-form/?file=waveagent_mac_v1-20

and then follow the instructions here

https://www.sounddevices.com/installing-wave-agent-on-mac-os-catalina-and-big-sur/

Mic

Kalman Tarr

unread,
Apr 25, 2023, 1:21:18 PM4/25/23
to QLab
Thank you Mic,
Looks it working on M1 Ventura.
(After that I follow Ben's Link too.)
Best
Kalman

Reply all
Reply to author
Forward
0 new messages