Getting the numeric index of a folder or file

Hi all,
I need to get the position number of a folder or file within another folder. I have tried a few things with no success.
I think this is done using the index command but so far have had no success.
Please help!:smiley:

I am running tiger 10.4

Hi :slight_smile:
Here one small suggestion:


tell application "Finder"
	-- Choose folder
	set theFolder to (choose folder default location (path to desktop folder) without invisibles) as alias
	-- Get the name of every item
	set theNameList to name of every item of folder theFolder
	-- Get the index of every item
	set theIndexList to index of every item of folder theFolder
	-- Check result
	return {theNameList, theIndexList} -- {{"01.txt", "02.txt", "03.txt"}, {1, 2, 3}}
end tell

I hope this helps…

Thanks for the reply. What you suggested kind of worked, but it was very helpfull in giving me another angle to work from. Cheers.:smiley: I ended up just doing a count of the list of contents of a folder and working from that.