Sunday, June 7, 2020

#1 2019-10-06 06:20:51 pm

peavine
Member
From:: Prescott, Arizona
Registered: 2018-09-04
Posts: 489

Applescript on Catalina

Catalina will probably release this week, and, in preparation, I have been doing a little research on changes to AppleScript. Thus far I've found very little.

The Catalina developer release notes contain the following paragraph:

"To enhance security, AppleEvents and AppleScripts that target an app on a remote system must authenticate as the same user on the remote system. An AppleEvent that targets an app running as a different user receives a procNotFound error."

https://developer.apple.com/documentati … ease_notes

The only pertinent post in this forum concerning Catalina has to do with mail attachments, although it is uncertain if this is a Catalina issue or not:

https://macscripter.net/viewtopic.php?id=47072

Finally, any AppleScript that scripts iTunes will need to be revised.

So, for me, all my Applescripts should work fine. smile

Edit December 10, 2019. I just discovered that the default shell in Catalina is changed from Bash to ZSH. Seldom an issue in an AppleScript but worth noting.

Last edited by peavine (2019-12-10 07:55:02 am)


2018 Mac mini - macOS Catalina

Offline

 

#2 2019-10-06 09:53:58 pm

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 6371

Re: Applescript on Catalina

There are some other issues.

* Command-line tools are also subject to Gatekeeper security.

* The first time a script tries to access files in certain places -- desktop, downloads, removable drives, network volumes, among others -- authorization will be sought.

* There are some issues with script libraries that access third-party frameworks.


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/
latenightsw.com

Offline

 

#3 2019-10-07 07:55:58 am

peavine
Member
From:: Prescott, Arizona
Registered: 2018-09-04
Posts: 489

Re: Applescript on Catalina

Thanks Shane. I knew there just had to be some additional issues. smile

I use a number of command-line tools in my AppleScripts, including a few downloaded from the internet, and the first issue you note will affect me. I'll get to work on this as soon as Catalina is released.

Last edited by peavine (2019-10-07 03:56:47 pm)


2018 Mac mini - macOS Catalina

Offline

 

#4 2019-10-07 04:14:06 pm

peavine
Member
From:: Prescott, Arizona
Registered: 2018-09-04
Posts: 489

Re: Applescript on Catalina

Well, I was wildly optimistic to think that Catalina would work with all of my existing Applescripts, and, in fact, the opposite is closer to the truth.

The biggest issue is command-line utilities that I downloaded from the internet. For example, when running a script that uses one of these utilities, I receive a dialog with the following:

"[utility name] cannot be opened because the developer cannot be verified"

The dialog options are Move to Trash and Cancel.

I added the command-line utility to Accessibility and Full Disk Access under Security and Privacy in System Preferences but that didn't help. sad

Last edited by peavine (2019-10-07 04:15:31 pm)


2018 Mac mini - macOS Catalina

Offline

 

#5 2019-10-07 05:00:29 pm

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 6371

Re: Applescript on Catalina

peavine wrote:

The biggest issue is command-line utilities that I downloaded from the internet.



You will need to track down signed and notarized versions.


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/
latenightsw.com

Offline

 

#6 2019-10-07 06:36:01 pm

peavine
Member
From:: Prescott, Arizona
Registered: 2018-09-04
Posts: 489

Re: Applescript on Catalina

Shane Stanley wrote:

You will need to track down signed and notarized versions.



Thanks Shane for the response. I had so much trouble with Catalina--both hardware and software--that I've gone back to Mojave for now.

Last edited by peavine (2019-10-07 08:53:32 pm)


2018 Mac mini - macOS Catalina

Offline

 

#7 2019-10-08 08:48:39 am

peavine
Member
From:: Prescott, Arizona
Registered: 2018-09-04
Posts: 489

Re: Applescript on Catalina

I heard back from the developer of the command-line utility which refused to run under Catalina. He provided a workaround, and I thought I would post it here because it might work with other similar utilities.

The developer's workaround and other comments are:

Here is the procedure:

1. Try to run cpdf executable from the terminal: a whinge box appears. Click 'cancel'.

2. Open System Preferences --> Security and Privacy --> General

3. Cpdf is listed as being banned. Click "Allow Anyway".

This process allows me to run cpdf ok on catalina (release version).

My understanding is that Apple will actually enforce the new, more draconian, policy from January 2020. I will make sure we're ready for that by providing a new executable.


2018 Mac mini - macOS Catalina

Offline

 

#8 2019-10-15 05:38:37 am

maro
Member
From:: Nerima, Tokyo, Japan
Registered: 2004-05-30
Posts: 104
Website

Re: Applescript on Catalina

I can not use remote AppleEvent between 10.15 machines with AppleScript applet.
The compiling phase does not finish (causes AppleEvent timed out after 180 seconds' wait).

Hmm...

Model: MacBook Pro 2012
AppleScript: 2.7
Browser: Safari 13.0.1
Operating System: macOS 10.14


I wrote thousands of AppleScript to realize my idea. Natural language interface, voice recognition commander and so on. Though my mother toungue is strange language, Japanese, my most frequently write language is AppleScript. I believe it is for making things easy and powerful.


Filed under: bug, macOS 10.15

Offline

 

#9 2019-10-15 05:42:51 am

StefanK
Member
From:: St. Gallen, Switzerland
Registered: 2006-10-21
Posts: 11686
Website

Re: Applescript on Catalina

I'd recommend to specify the remote machine in a property

Applescript:

property remoteMachine : "eppc://user:pass@host.local/?uid=501"

The benefit is that the property doesn't affect the compiling process and you can see if there are other issues.

I'm able to send Apple Remote Events at least from Mojave to Catalina.

Last edited by StefanK (2019-10-15 05:46:58 am)


regards

Stefan

Offline

 

#10 2019-10-15 10:13:27 pm

maro
Member
From:: Nerima, Tokyo, Japan
Registered: 2004-05-30
Posts: 104
Website

Re: Applescript on Catalina

Thank you! I ensured it works on macOS 10.15.

macOS 10.15 Server---macOS 10.15 Client : ok
macOS 10.15 Server---macOS 10.14 Client : ok

Model: MacBook Pro 2012
AppleScript: 2.7
Browser: Safari 13.0.1
Operating System: macOS 10.14


I wrote thousands of AppleScript to realize my idea. Natural language interface, voice recognition commander and so on. Though my mother toungue is strange language, Japanese, my most frequently write language is AppleScript. I believe it is for making things easy and powerful.


Filed under: eppc

Offline

 

#11 2019-12-08 08:28:35 am

peavine
Member
From:: Prescott, Arizona
Registered: 2018-09-04
Posts: 489

Re: Applescript on Catalina

I thought I would add a postscript to this thread.

When I initially upgraded to Catalina, I encountered three significant issues that pretty much forced me to return to Mojave. These were a bug that prevented my 4k monitor from working in 4k mode, a lack of support of Catalina by the SuperDuper backup app, and my inability to get an important command-line utility to run.

Those issues were resolved and I'm now successfully running Catalina (10.15.1). I had to make some minor changes to a few AppleScripts, and the required file-access authorizations can be irritating, but neither of these is a deal-breaker for me. I can't say I use any of the new features of Catalina, but it's nice to be up to date.

BTW, beta 4 of 10.15.2 was released two days ago and hopefully we will see that upate before long.


2018 Mac mini - macOS Catalina

Offline

 

#12 2019-12-08 04:49:44 pm

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 6371

Re: Applescript on Catalina

You're having better luck than me. A couple of kernel panics, spurious permission issues, and problems opening and saving scripts if Full Disk Access is not turned on.


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/
latenightsw.com

Offline

 

#13 2019-12-11 06:35:45 pm

peavine
Member
From:: Prescott, Arizona
Registered: 2018-09-04
Posts: 489

Re: Applescript on Catalina

Catalina 10.15.2 is out and works great for me. Shane does a lot of complicated stuff, so it's not surprising that he would run into issues that don't impact me.

Under Catalina the boot drive is now divided into two volumes, which for me are:

Macintosh HD
Macintosh HD - Data

I run the following:

Applescript:

tell application "Finder" to set theFile to selection as text

and it returns:

Macintosh HD:Users:peavine:Working:New Text File.txt



I was just curious why this is, because I would expect it to be:

Macintosh HD - Data:Users:peavine:Working:New Text File.txt



I assume that the Data volume is mirrored somehow in the Macintosh HD volume, but I wondered how this works.

Also, I was a bit surprised that the following errors:

Applescript:

alias "Macintosh HD - Data:Users:peavine:Working:New Text File.txt"

And, the following does not:

Applescript:

alias "Macintosh HD:Users:peavine:Working:New Text File.txt"

Last edited by peavine (2019-12-11 07:03:40 pm)


2018 Mac mini - macOS Catalina

Offline

 

#14 2019-12-11 08:39:00 pm

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 6371

Re: Applescript on Catalina

The drives appear as a single drive by the use of firmlinks, which are a bit like symlinks. These merge the contents of the two drives, so everything except some low-level tools still see a single volume, in your case Macintosh HD.


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/
latenightsw.com

Offline

 

#15 2019-12-12 07:35:09 am

peavine
Member
From:: Prescott, Arizona
Registered: 2018-09-04
Posts: 489

Re: Applescript on Catalina

Thanks Shane. I googled firmlinks and found an informative ars Technica article that explains all of this. None of this directly impacts AppleScripting but it's interesting to know how things works.

https://arstechnica.com/gadgets/2019/10 … iew/11/#h1


2018 Mac mini - macOS Catalina

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)