Hi,
it seems to be hard to hard code paths into AppleScripts. It mostly uses
classic MacOS notation, which I don't like and which doesn't have ~. So
I wrote the following:
on unixToClassic(thePath)
set delimiterBackup to text item delimiters
set text item delimiters to ":"
set classicPath to text items of (POSIX file thePath as string)
set homePath to text items of (path to home folder as string)
set homePath to reverse of rest of reverse of homePath -- remove last
item
if second item of classicPath is "~" then
set classicPath to homePath & (items 3 thru end of classicPath)
end if
set theResult to a reference to file (classicPath as string)
copy delimiterBackup to text item delimiters
return theResult
end unixToClassic
But there has to be a shorter way. When telling "Image Events" I can do
this:
set the parent_folder to folder "Outbox" of the desktop folder
However it does not work with paths, so I'd have to make an "of folder"
chain.
Isn't there an easy way to "open for access" a certain file inside my
home without using "choose"?
--
Tobias Weber