Re: do shell script modifies alias path
Re: do shell script modifies alias path
- Subject: Re: do shell script modifies alias path
- From: Paul Berkowitz <email@hidden>
- Date: Wed, 03 Mar 2004 21:22:18 -0800
On 3/3/04 8:57 PM, "Malcolm Fitzgerald" <email@hidden> wrote:
>
Would someone explain this to me please.
>
>
set f to (choose file)
>
--> alias
>
"Hogg:Users:malcolm:Documents:ASA:web:logs:error:2004:03-Mar:error_log.2.gz"
>
set pf to POSIX path of f
>
get f
>
--> alias
>
"Hogg:Users:malcolm:Documents:ASA:web:logs:error:2004:03-Mar:error_log.2.gz"
>
do shell script ("gunzip " & pf)
>
get f
>
--> alias
>
"/Users/malcolm/Documents/ASA/web/logs/error/2004/03-Mar/error_log.2.gz"
>
>
why does the do shell script step alter the variable f?
Does the original file still exist after gunzipping it (whatever that may
be)?
I have noticed exactly the same strange POSIX path as for an alias saved as
a script property, when retrieved from the script after trashing and
emptying the file it pointed to or (more frequently) moving the script to
another disk partition or computer. In the old days this would error, now it
gives this strange POSIX alias.
It means I have to rewrite about 74 scripts where I was oh-so-careful to do
this:
property savedFile : missing value
try
get savedFile
on error
set savedFile to missing value
end try
if savedFile = missing value then
set saved file to (choose file with prompt "Where'd you put it now?")
end if
----------
Now it never errors in the try block, so the user is never asked to choose
the file, Then it errors later on with some weird error which is hard to
track down. Usually the error begins
File file something/Or/Other cannot be made into a file
or something silly along those lines.
I've guessed that the POSIX path thing (it's very strange-looking when the
alias was to another partition - I think it begins with a colon before all
the forward slashes take over) may indicate the format in which the file
system now stores its own pointers to files. The pointer may still be there
even though the file is gone.
Maybe a Chris can tell us.
--
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.