Old 01-05-2019, 05:50 PM   #1
preferred.nomenclature
Human being with feelings
 
Join Date: Dec 2014
Posts: 304
Default Get last selected item?

If multiple items are selected, is it possible to know which was the last selected item?
preferred.nomenclature is offline   Reply With Quote
Old 01-05-2019, 06:05 PM   #2
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 883
Default

The item count minus one?...
Code:
count = reaper.CountSelectedMediaItems(0)
last = reaper.GetSelectedMediaItem(0,count-1)

Last edited by Edgemeal; 01-05-2019 at 06:20 PM. Reason: typo
Edgemeal is offline   Reply With Quote
Old 01-05-2019, 06:31 PM   #3
preferred.nomenclature
Human being with feelings
 
Join Date: Dec 2014
Posts: 304
Default

Sorry, I mean last as in most recently selected; as far as I can tell GetSelectedMediaItems is indexed by (track number).(item ordinal in track) - am I wrong about that?
preferred.nomenclature is offline   Reply With Quote
Old 01-06-2019, 12:56 AM   #4
dsyrock
Human being with feelings
 
dsyrock's Avatar
 
Join Date: Sep 2018
Location: China
Posts: 90
Default

Quote:
Originally Posted by preferred.nomenclature View Post
If multiple items are selected, is it possible to know which was the last selected item?
I think the answer is yes, but you need a script that running in defer mode, to store all the items which you selected every time. Maybe it is not CPU friendly.
dsyrock is offline   Reply With Quote
Old 01-06-2019, 06:34 AM   #5
preferred.nomenclature
Human being with feelings
 
Join Date: Dec 2014
Posts: 304
Default

Heh, I was afraid that might be the case. Thanks!
preferred.nomenclature is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 03:00 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.