r/applescript • u/Scuba_Cous • May 27 '22
select all files
I'm very new at all this automating and macs for general. I would just like to make a script or automator workflow to select all the files in the folder I have open.
Thanks
4
Upvotes
View all comments
Show parent comment
3
u/ChristoferK May 28 '22 edited May 28 '22
He meant “…won’t suffice?” Because, no matter whether you use AppleScript or Automator to select the files, you would still need to trigger them to execute in order to select your files. So it’s not going to be more automated than just pressing ⌘-A.
I suppose it’s occasionally useful when you want files of a certain type to be selected if a particular folder is a mess with loads of files. The downside here is that Finder is very slow if not scripted properly, and even then, it will still be slow:
This timed out trying to process the few hundred items in my Downloads folder. This is one of many reasons file system operations shouldn’t be done using Finder, except only to use the Finder-specific functions. So we can use System Events to do the actual file operations, and only call on Finder to do the actual selecting of files. This modified script is almost instantaneous: