My current problem is, I need to find a way to get the file name and desktop position of all items on the desktop. I have this script which works (In a way):
tell application "Finder"
set names to name of items of desktop
set positions to desktop position of items of desktop
return {names, positions}
end tell
So what this does is it return an array of two items the first array item is an array of desktop item names, the second array item returns an array of desktop item positions. The problem is though that I can not guarantee that item 1 of the name array corresponds to item one of the position array.
{{"Macintosh HD", "Games", "Development"}, 1362, 55}, {1232, 325}, {1228, 423}}
What I am doing now from my Cocoa app is sending individual requests for the desktop position of Items I find in the users Desktop folder. This is very slow, to ask for each individually. So what I want to do is ask for them as a group as I did above. But I want to order them so the Item name and desktop position are paired up with each other. So for example like this:
{{"Macintosh HD",{1362, 55}},{"Games",{1232, 325}}, {"Development", {1228, 423}}}
So what I would like to do is have a script do something like this:
tell application "Finder"
set {names, positions} to name of items of desktop and desktop position of items of desktop
set NamesPos to {names, positions}
return NamesPos
end tell
(The above script is just an example, it does not really work)
So it would somehow come out like above with the Name and position pair. Can any one help with this. Also if you can think of a different way to do this please let me know.
Thanks in advance.