Re: I've changed the name of a file - now how do I get at path to the new name?
Re: I've changed the name of a file - now how do I get at path to the new name?
- Subject: Re: I've changed the name of a file - now how do I get at path to the new name?
- From: Len Senater <email@hidden>
- Date: Fri, 3 Nov 2000 11:51:04 -0500
>
on 11/2/00 9:26 PM, Len Senater at email@hidden wrote:
>
>
> I've got a variable (vPathName) that contains a reference (i.e. path) to
>
> a file:
>
>
>
> --> file "Work:DMS Group:Database:Test Images:xxx.jpg"
>
>
>
> I can change the name of the file by:
>
>
>
> set the name of vPathName to "NewFileName"
>
>
>
> great, however the variable still contains the path to the old file name.
>
>
>
> How do I get the path to the newly renamed file?
>
>
>
> I need it to put back into the database (FileMaker) where I got the
>
> original pathname, so that it will point to the correct (i.e. renamed)
>
> file.
>
>
>
>
>
> Thanks,
>
>
>
> LEN
>
>
>
>
tell application "Finder"
>
set vPathName to (file "Work:DMS Group:Database:Test Images:xxx.jpg") as
>
alias
>
set the name of vPathName to "NewFileName"
>
end tell
>
>
return vPathName
>
--> alias "Work:DMS Group:Database:NewFileName"
>
>
John
>
>
almost perfect - however I start with
file "Work:DMS Group:Database:Test Images:OldFileName"
but I end up with
alias "Work:DMS Group:Database:Test Images:NewFileName"
FileMaker will not accept an alias reference - it must be a file reference
Can I easily turn one into the other?
Thanks,
LEN