Page 1 of 1
tab("get", "index", -1)
Posted: 13 May 2025 06:31
by Evolve
Hey guys, what’s going on. I've been busy recently and have missed a couple of updates. I've updated from v23 to v27 and some of my scripts broke cause of this line of code that finds the last tab index:
msg(tab("get", "index", -1));
Tab name not found
Re: tab("get", "index", -1)
Posted: 13 May 2025 07:40
by highend
Code: Select all
v25.00.0213 - 2023-10-27 16:44
+ SC tab enhanced: Instead of the index, you can now pass the caption or the path of
the tab. Tabs are searched from left to right, the first match wins.
Syntax: tab([operation], [data], [index], [ID])
index: Refers to a tab by its position, first tab = 1.
Alternatively pass the name (if you named the tab via "Rename Tab...") or
the path. Wildcards * and ? are supported.
Defaults to the current tab. See also individual descriptions above under
each operation.
Remarks:
- The matching is case-insensitive (A==a).
- If there is no match, an error message "Tab name not found" is displayed and no
operation is performed.
Examples:
tab("close", , "Mickey"); //close first tab called "Mickey" (no prompt)
tab("close", , "Desktop\Desk"); //close first tab pointing to "Desktop\Desk" (no prompt)
echo tab("get", "ID", "*23"); //get ID of first tab whose name ends with "23"
Re: tab("get", "index", -1)
Posted: 15 May 2025 16:13
by altoclef
Evolve wrote: ↑13 May 2025 06:31
msg(tab("get", "index", -1));
Tab name not found
Errors for me too.
tab() help says:
Notes
If index is negative then position is calculated from the right end (-1 points to the right-most tab).
and includes the example
tab("lock", , -1); which also fails for me with the same error message.
Re: tab("get", "index", -1)
Posted: 27 May 2025 09:36
by admin
That's a bug.

Fixed in next beta.

Re: tab("get", "index", -1)
Posted: 28 May 2025 23:59
by altoclef
Confirmed fixed in v27.00.0503. Thank you.
