“Set position” Applescript command does not work with Snow Leopard’s Finder
| Originator: | zonble | ||
| Number: | rdar://7186342 | Date Originated: | 01-Sep-2009 06:22 PM |
| Status: | Open | Resolved: | |
| Product: | Mac OS X | Product Version: | 10.6 |
| Classification: | Reproducible: | Always |
01-Sep-2009 06:22 PM Weichung Yang:
Summary:
The Applescript command “set position” is used to ask Finder to set the position of the icon a Finder item, such as a file, a folder and so on, in its container window. It works perfectly with Mac OS X 10.5 Leopard and other previous versions, but it does not work with Snow Leopard. After calling the command, the icon remain staying in the original position.
Steps to Reproduce:
1. Create a folder named “Test” on the desktop, and put a file named “test.txt” in to the “Test” folder.
Launch the Script Editor application.
Run the following script
tell application "Finder"
set test to folder "Test" of desktop
open test
tell window of test
set current view to icon view
end tell
set opts to the icon view options of window of test
tell opts
set icon size to 128
set arrangement to not arranged
set label position to bottom
set text size to 12
end tell
set position of item "test.txt" of test to {100, 100}
end tell
Expected Results:
The icon of test.txt should be move to position {100, 100}
Actual Results:
The icon does not move
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!
Possible Work-around
I'm also a victim of this very annoying bug.
As it seems, if run from inside a shell script, running the commands twice seems to solve the problem for me. If it is in an osascript, a sequence of
close openafter setting the position also seems to help.