Sorting items by name in a list - InDesign CS4

Hello group,

I’m a new member to the group, as well as a novice at applescript. What I am trying to achieve is to pull the image name and size of the image frame out of an InDesign document, and write that information to a simple text file on the dekstop. The script as it is currently written does work, however, I was wondering if there is any way to sort the list of image data alphabetically? One other thing that seemed odd was whenever I tried to tell the height and width to round UP, it would only round DOWN (I have removed the rounding from the script already). Any help or suggestions would be greatly appreciated. Thank you in advance for your time and consideration. Here is what I have so far:


set myList to {}
tell application “Adobe InDesign CS4”
set myDocument to active document
set horizontal measurement units of view preferences of myDocument to inches
set vertical measurement units of view preferences of myDocument to inches
set ruler origin of view preferences of myDocument to page origin
set zero point of myDocument to {0, 0}
set myImages to all graphics of myDocument
repeat with myCounter from 1 to (count of myImages)
set myImage to item myCounter of myImages
set myLink to item link of myImage
set myImageName to name of myLink
set myBox to parent of myImage
set myBounds to get the visible bounds of myBox
set myY to item 1 of myBounds
set myX to item 2 of myBounds
set myHeight to ((item 3 of myBounds) - myY)
set myHeight to (((myHeight * 10) + 0.5) div 1) / 10
set myWidth to ((item 4 of myBounds) - myX)
set myWidth to (((myWidth * 10) + 0.5) div 1) / 10
set myImageData to {myImageName, (" “), myWidth, (” x "), myHeight} as text
copy myImageData to end of myList
end repeat
set myPath to path to desktop as text
set myDoc to “Image Sizes.txt”
set oldDelims to AppleScript’s text item delimiters
set AppleScript’s text item delimiters to {return}
set myData to myList as text
set AppleScript’s text item delimiters to oldDelims
set myFile to (open for access file (myPath & myDoc) with write permission)
set eof myFile to 0
write myData to myFile
close access myFile

set myDocument to active document
display dialog "Processing complete! All image sizes have been calculated and written to a file on your desktop."

end tell

Mike

Browser: Firefox 3.5.2
Operating System: Mac OS X (10.6)