Help!!
I have put in many hours trying to solve this and feel it is time to get some help :)
I am trying to write an Applescript in Automator that will execute certain keystrokes in Finder for the parent folder and each sub-folder. So far I can only get the keystrokes to be applied to the parent folder that is selected during the execution of the script; the sub-folders remain as they were without having had the keystrokes applied.
The keystrokes are specific to Finder and make the folder arranged by "Kind" and sorted by "Name".
Here is my code:
activate application "Finder"
tell application "Finder"
set theFolders to every folder of (choose folder) as alias list
end tell
tell application "System Events"
repeat with eachFolder in theFolders
keystroke "2" using {control down, command down}
keystroke "1" using {control down, option down, command down}
end repeat
end tell
The code makes sense to me in my limited knowledge of Applescript, but obviously it is not working correctly.
Any advice?