Select LAST

It's my first post here! This seems like such a simple thing, but I couldn't find it in the search, so here goes...

How can I make a user command that selects the last file in the active lister? I found
Select FIRST
which works a treat, but for some reason there is no
Select LAST
Is there another way?

This would be very useful in my function that opens a directory and sorts by modified. I find myself always hitting the End key to go to the latest file, so I would love to be able to incorporate it into the function.

Sort in reverse order and select first?

You could use the "end" key.

Is there a way to simulate an "End" key from code?

Reverse sort is a good suggestion, but I'm not used to it being upside down, so I'd sort back straight after:

Go LASTACTIVELISTER
Go NEWTAB=findexisting PATH="&PATH&"
Set SORTBY=modified SORTREVERSE=On
Select FIRST
Set SORTREVERSE=Off

It works, but it runs quite slow :frowning:

Select FIRST
Select PREV

Seems to do what you want.

FRegards, AB

Ohhh it works! Nice one, thanks aussieboy :grin: