Accessing the Focused item (to deselect all files with same extension)

Here's an operation I'm grappling with:

  1. Given a list with a bunch of selected items...
  2. Focus one of the items, say, a file
  3. Invoke some command to unselect all items with the same extension as that focused file.

And just to be clear, when I say 'focused', I mean precisely that - the item with a focus rectangle (and not a selected item).

I couldn't find anything relevant in Codes for passing filenames or among Item properties. Are focused items accessible in some way to standard functions or scripts? And if not, might there be some cunning alternative to implement that "deselect similar items" feature (sort of Select SIMILAR in reverse)?

Thank you!

I don't think there is a way for buttons or scripts to query which file has focus (rather than selection) at the moment.

I see... Well, this could be a useful addition to both 'codes' and Item properties, I suppose. Thanks, Leo.

Please link your account to request features.

I'm posting here because this thread is one of the first you find when you search "focused item", and it says there is currently no way to query it: this information is outdated, now there is a way.

1 Like