Ventura and Path to Me

I have found that using “path to me” in a a compiled AppleScript application leads to an error that is something like:
Can’t make “414E8BFC-6972-456F-8106-9DF602ED9556:d:Subject and Email.txt” into type alias. (-1700)

specifically in Ventura. Has anyone else experienced this? Is there some alternate, other than “path to current application” ?

This error is most likely related to something else.

Path to me works as expected on my Ventura computer–both if run from within Script Debugger and if run as an AppleScript application on the desktop. I agree with KniazidisR that something else is causing the error, and the reported error message supports this.

-- results if run from within Script Debugger
set thePath to path to me --> alias "Macintosh HD:Users:Robert:Desktop:Test.app:"
tell application "Mail" to set thePath to path to me --> alias "Macintosh HD:Users:Robert:Desktop:Test.app:"

-- results if run as an app on the desktop
set thePath to path to me
display dialog thePath as text --> Macintosh HD:Users:Robert:Desktop:Test.app:
set thePath to path to current application
display dialog thePath as text --> Macintosh HD:Users:Robert:Desktop:Test.app:
tell application "Mail" to set thePath to path to me
display dialog thePath as text --> Macintosh HD:Users:Robert:Desktop:Test.app:

My bad, I did not think that through. It was not working with path to me, and I got it working with path to application so I figured it was path to me that was broken.

But it was not path to me that was throwing the error, it was when I was trying to create an alias to a file in the same directory as my script.

use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
use script "FileManagerLib" version "2.3.5"
set pathTome to path to me as text
set parsedPath to items 1 thru -3 of parseText(pathTome, ":")
set {saveTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, {":"}}
set initialPath to parsedPath as string
set AppleScript's text item delimiters to saveTID
set thePath to (initialPath & ":" & "SavePath.txt") as alias

So it is the “set thePath to…” that is generating the error, but I can’t figure out what I did to generate that string of hex that appears in the error? Again, I have only see this error on Ventura.

I’ve seen the error in Ventura too. I moved inside tell application “system events” and it works reliably.

1 Like