• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Modifying aliases...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Modifying aliases...
      • From: mjn <email@hidden>
  • Prev by Date: Help! "info for" in 9.2.2 and AS 1.7 = lockup!
  • Next by Date: Newbie question - listing items in the trash
  • Previous by thread: Help! "info for" in 9.2.2 and AS 1.7 = lockup!
  • Next by thread: Re: Modifying aliases...
  • Index(es):
    • Date
    • Thread