Re: Reading a file in the user's home Documents
Re: Reading a file in the user's home Documents
- Subject: Re: Reading a file in the user's home Documents
- From: Paul Berkowitz <email@hidden>
- Date: Thu, 11 Sep 2003 18:47:38 -0700
On 9/11/03 5:25 PM, "Dave Stewart" <email@hidden> wrote:
>
After a half an hour trying to figure out the syntax of:
>
>
set theUserCodePath to (((path to current user folder) as text) &
>
"Documents:updateScriptKey" as POSIX file)
>
>
so I can
>
>
set theFileToRead to open for access theUserCodePath
>
>
I give up.
Is there any particular reason why you're trying to get a POSIX file? (Let
alone why you've arranged your parentheses so that only the last bit -the
bit of the path from "Documents" on - has that unusual criterion applied to
it.)
set theFileToRead to alias ((path to current user folder as Unicode
text) & "Documents:updateScriptKey" )
or
set theFileToRead to alias ((path to "docs" as Unicode text) &
"updateScriptKey" )
AppleScript uses colon-delimited path names. You only need POSIX files for
'do shell script' (i.e. Unix operations) and AppleScript Studio (i.e.
Cocoa). And TextEdit, as mangled by a developer who didn't know AppleScript.
>
Only
>
AppleScript can make this simple an operation so convoluted that I have
>
to ask the list how to do it. Any other language and I would have
>
figured it out 29 minutes ago.
It _is_ simple. Why do you find it necessary to berate AppleScript for your
own lack of knowledge? Try reading the AppleScript Language Guide to learn
about AppleScript.
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.