Post

Replies

Boosts

Views

Activity

Reply to AppleScript, Do Shell. How do I write the "test" command to the "script editor"?
This simple handler can detect if a path is valid without asking System Events or the Finder. It is also faster. on ExistsThisPath(thePath) try alias thePath return true on error return false end try end ExistsThisPath --> works for folders set theFolder to (choose folder) as string --> I chose "Macintosh HD:Users:jean:Documents:" set AreUthere to ExistsThisPath(theFolder) --> true set AreUthere to ExistsThisPath("Macintosh HD:Users:jean:Docs:") -->false --> works for files set theFile to (choose file) as string --> I chose "Macintosh HD:Users:jean:Documents:Expresso.pdf" set AreUthere to ExistsThisPath(theFile) --> true if you have an HFS path, convert it to Posix like this: set HFS_Path POSIX to file "MacIntosh HD/Users/jean/"
Oct ’25
Reply to AppleScript, Do Shell. How do I write the "test" command to the "script editor"?
This simple handler can detect if a path is valid without asking System Events or the Finder. It is also faster. on ExistsThisPath(thePath) try alias thePath return true on error return false end try end ExistsThisPath --> works for folders set theFolder to (choose folder) as string --> I chose "Macintosh HD:Users:jean:Documents:" set AreUthere to ExistsThisPath(theFolder) --> true set AreUthere to ExistsThisPath("Macintosh HD:Users:jean:Docs:") -->false --> works for files set theFile to (choose file) as string --> I chose "Macintosh HD:Users:jean:Documents:Expresso.pdf" set AreUthere to ExistsThisPath(theFile) --> true set PosixPath to "/Users/jean/Documents/Expresso.pdf" ExistsThisPath(POSIX file PosixPath) --> true
Oct ’25