views:

32

answers:

1

is it possible to specify a Finder item by its path?

e.g. I want to refresh the icon of a single item. So far, to do this, I call update on every item of the front window:

tell application "Finder" to update every item in front window

But this only works if the folder currently has the item. Is it possible to specify an item with its path, so that the update will work even if the item is not visible in Finder?

tell application "Finder" to update item_x

where item_x is the item i want to update?

+1  A: 

sure just give it an alias but then your hard coding it in there

   tell application "Finder" to update "path:to:your:file.ext"

of course there are many more approaches you can take for this it just depend on how you want to get the item(s) you could

have a script in your menu that asks for an item using choose file

have a script in your menu that asks for a folder using choose folder

maybe some other options I'm sure.. can you provide more information what the process is ?

mcgrailm
took your advice and it works. i generated the alias from the POSIX path of an item then passed it to `update`. but Finder doesn't seem to want to update the icon for any item that isn't currently visible (displayed onscreen). thanks for this, though. (i'm trying to refresh icons real-time when one is edited)
maranas