How to select items by extension via script?

Discuss and share scripts and script files...
Post Reply
Papoulka
Posts: 455
Joined: 13 Jul 2013 23:41

How to select items by extension via script?

Post 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

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Unbelievably basic noob question

Post 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. ;)

Papoulka
Posts: 455
Joined: 13 Jul 2013 23:41

Re: How to select items by extension via script?

Post 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.

Post Reply