Hello,
In this script, I am taking the contents of the front finder window and placing the names of the files in a text document. I have a few questions that I do not understand and hopefully someone can explain them to me ![]()
tell application "Finder"
set these_items to sort (get every document file of the front Finder window) by physical size
set these_names to {}
repeat with i from 1 to the count of these_items
set the end of these_names to the name of (item i of these_items)
end repeat
end tell
set AppleScript's text item delimiters to return
set the item_list to these_names as string
set AppleScript's text item delimiters to {""}
tell application "TextEdit"
activate
make new document
set text of document 1 to the item_list
end tell
Question 1- in these lines:
set the item_list to these_names as string
set AppleScriptâs text item delimiters to {ââ}
Can someone please tell me, why the ââ are necessary? It seems if I remove them, it still works? I assume it has to do with line above it, as string? but I am just not sure about these 2 lines.
Question 2- I Sorted the list by physical size as indicated, and then I tried name, which worked fine, but when I try modification date or creation date, the order changes, but it is not correct. This is not the first time I have tried to do something with date order that made a different order than it should of. Is there a logical reason for this?
Question 3-right now I am just getting the files in the front finder window, if there were a mix of files and folderâs, how might I ask for that? I tried âget every document file of the front Finder window and every folder of the front Finder windowâ, but of course that didnât work ![]()
If someone could explain any of these, It would be helpful ![]()
thanks
babs