Converting Script from High Sierra to Catalina

I have the following code that works fine on High Sierra, but failed on an Error Type -10810 on Catalina (v10.15.7). Can’t find on the web what AppleScript Error Type -10810 is.

property zOpenClientsPath : "/Applications/Endive Clients/zOpen Clients/"
property ExcelDataPath : "/Applications/Endive Clients/Utilities/EndiveIPAddress.txt"

property watcherName : "EndiveWatcherv17.app"

set zOpenClientsFolder to zOpenClientsPath as POSIX file

set watcherPath to ((zOpenClientsFolder as text) & watcherName)
tell application watcherPath
	if (not running) then run
end tell

Any idea what AppleScript Type Error -10810 is?

Error -10810 is a Launch Services result code indicating an unknown error.

Run

command throws this error in your script

FWIW, I did a Google search on “mac error 10810” (omit quotes) and there was a lot of information on this topic. The “-” before “10810” has to be omitted of course.

It seems as permissions problem.

I have not your server app, so I show here how to fix the problem using “Finder” for sub_application of Microsoft Excel.app package:


property zOpenClientsPath : "/Applications/Microsoft Excel.app/Contents/SharedSupport/"
property watcherName : "Microsoft Error Reporting.app"

set zOpenClientsFolder to zOpenClientsPath as POSIX file
set watcherPath to ((zOpenClientsFolder as text) & watcherName)

tell application watcherPath to set isRunning to its running
if (not isRunning) then tell application "Finder" to open watcherPath

You own script should be like this:


property zOpenClientsPath : "/Applications/Endive Clients/zOpen Clients/"
property ExcelDataPath : "/Applications/Endive Clients/Utilities/EndiveIPAddress.txt"

property watcherName : "EndiveWatcherv17.app"

set zOpenClientsFolder to zOpenClientsPath as POSIX file
set watcherPath to ((zOpenClientsFolder as text) & watcherName)

tell application watcherPath to set isRunning to its running
if (not isRunning) then tell application "Finder" to open watcherPath

KniazidisR - I got past the 10810 error by inserting your suggestion, but now I get an error message that the EndiveWatcherv17.app can’t be opened which I assume is due to the new Catalina OS file system and the resulting permissions (or lack thereof).

How do I get Catalina to allow me to Open the EndiveWatcherv17.app?

I had to recompile the app now it opens fine.

Thanks for your help!