Page 1 of 1

How to select items by extension via script?

Posted: 27 May 2014 21:57
by Papoulka
So I thought I would try a script...

I have now spent well over an hour trying everything conceivable with "sel" and "selectitem", searching the script forum here, and google searches, with no luck. I am forced to ask this out loud:

--> How can I select all .JPG files in the current pane?

Nothing obvious works, including this:

sel "[*.jpg]";

I must be missing something very basic because this has to be one of the most common operations. I thought it would be trivial...

Thanks for any help

Re: Unbelievably basic noob question

Posted: 27 May 2014 22:06
by TheQwerty
You missed SelFilter:

Code: Select all

SelFilter '*.jpg', 'f';
It's a bit confusing given there's multiple commands for selecting items...
Sel selects one item by position or pattern.
SelectItems selects multiple items by path or name.
SelFilter selects multiple items by pattern.



Off-topic: In the future please try to use a subject that better describes your query. ;)

Re: How to select items by extension via script?

Posted: 27 May 2014 23:11
by Papoulka
Thank you. I knew it had to be something simple like that. I was working from the Help file list of Scripting Commands which, as it happens, does not group all the select commands together. Plus I didn't run across any sample scripts that used selfilter.

The title was out of sheer frustration after so much time.... now relieved.