Modifying aliases...
Modifying aliases...
- Subject: Modifying aliases...
- From: mjn <email@hidden>
- Date: Tue, 19 Mar 2002 10:03:57 -0600
I am looking to change the target of any alias and, with the help of a few
folks on the list, this is what I have:
<code>
property rootList : {{"Shared
Data:USERS:", "COAFES-USERS.USER:"}}
on aliasMod(the_file)
tell application "Finder"
set the_file to the_file's original item as string
end tell
repeat with theRoot in rootList
set old_root to theRoot's first item
if the_file starts with old_root then
set {TID, text item delimiters} to [NO BREAK]
{text item delimiters, oldRoot}
set newPath to theRoot's last item & oldPath's last text item
set text item delimiters to TID
return newPath
end if
end repeat
end aliasMod
</code>
I am calling this routine like this:
<code>
tell application "Finder" to set the_file's original [NO BREAK]
item to aliasMod(the_file)
</code>
Out ahead of this I have a routine which isolates all of the aliases in the
directories I am looking in. Those aliases are then passed to this
subroutine.
Basically what I'd like the routine to accomplish is: check to see if the
"original item" of the current alias matches any of the first elements of
the items in rootList and, if it does, replace it with the second element of
the same item in rootList.
I am not sure that if I reset the value, it automatically resets the
associated value on the original file.
Right now it is crapping out on "set the_file to the_file's original item as
string" and saying it cannot get that. I don't know if I am even
referencing the original item correctly.
Suggestions? Thanks again.
-mjn
_______________________________________________
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.