FYI, I asked an Apple employee yesterday if there is anything wrt AppleScript in 10.15. His reply was:
“No new features, a number of smallish bug fixes. There are two significant (potential) compatibility issues:
1. The dedicated System partition means many system folder locations have changed. If you’re hard-coding them, stop, and use “path to” instead.
2. “do shell script with administrator privileges” has a new implementation that improves security. However, it also precludes presenting UI from within the privileged command. Break the command apart so the privileged part is as small as possible.”
I doubt that’s necessary. What I’ve seen so far is that while the new Data volume that contains the user-modifiable part of the boot volume lurks in a new location (/System/Volumes/Data), Apple has taken care to match all the old paths up with it, so that you can find the SAME item now at both the old path (such as /Users/yourname/Desktop) as well as at the new path (/System/Volumes/Data/Users/yourname/Desktop). So, it appears all the known paths are still there, on purpose. But maybe the Apple guy meant something else?
Huh, I wonder what that means - My app Find Any File restarts itself (i.e. the entire app) with that old and deprecated API to get root access to all files, and yet its UI is still functioning well on 10.15b1.
Here is a clumsy workaround for this bug, only practical if your script doesn’t coerce a lot of POSIX paths. It’s based on this page, with one slight modification:
This is the handler (slightly modified from the original (I couldn’t make it work in my scripts until I added “as string”)
use framework "Foundation"
property NSString : a reference to current application's NSString
on remove:remove_string fromString:source_string
set s_String to NSString's stringWithString:source_string
set r_String to NSString's stringWithString:remove_string
return (s_String's stringByReplacingOccurrencesOfString:r_String withString:"") as string
To use it, immediately after you get a POSIX path, add this:
if myPosixPathVariable contains ":" then
set myPosixPathVariable to my remove:":" fromString:myPosixPathVariable
This is obviously a great waste of time, and anyone who knows anything about AppleScript can write something better, but it seems to get the job done while the bug remains unfixed.