Scripts on buttons

Things you’d like to miss in the future...
Post Reply
oblivion
Posts: 142
Joined: 13 Apr 2011 11:35

Scripts on buttons

Post by oblivion »

I have a couple of user defined buttons that invoke scripts.

Since the most recent update, (22.90.0100) instead of the button just invoking the script , it displays the first line, you click on that, it shows the whole script and the line you click on gets run...

Have I done something, or is this a bug?

(As a specific example, I have a button for Opus-style dual pane activation / deactivation that's worked fine for years:

Code: Select all

if !get("#800") {  //checks Dual Pane status
 #810;}   // go to dual pane if not already or you could get the active pane first, $a_path = get("path", a) and use it instead of <curpath>
 else {#800;}   //goes back to single pane if already in Dual Pane
And now, it doesn't work. :(
-- bests, Tim

...This space unintentionally left blank.

oblivion
Posts: 142
Joined: 13 Apr 2011 11:35

Re: Scripts on buttons

Post by oblivion »

...although the default dual pane button might now act the same way the script does, so maybe it's a bad example!
-- bests, Tim

...This space unintentionally left blank.

jupe
Posts: 2811
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Scripts on buttons

Post by jupe »

Yeah there has been a heap of changes with CTB's, one way to fix it would be to edit each button and add this on the first line by itself: //S eg: here is how your example button script would look:

Code: Select all

//S
if !get("#800") {  //checks Dual Pane status
 #810;}   // go to dual pane if not already or you could get the active pane first, $a_path = get("path", a) and use it instead of <curpath>
 else {#800;}   //goes back to single pane if already in Dual Pane

oblivion
Posts: 142
Joined: 13 Apr 2011 11:35

Re: Scripts on buttons

Post by oblivion »

Thanks!
-- bests, Tim

...This space unintentionally left blank.

admin
Site Admin
Posts: 60644
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Scripts on buttons

Post by admin »

Yep, there has been a heap of changes with CTB's. But full backward compatibility is still the goal, and we're coming nearer step by step. In the next beta your script will work again without any changes.

jupe
Posts: 2811
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Scripts on buttons

Post by jupe »

Yeah I assumed that would be the goal, but what about using single CID's requires a closing semicolon now (or prefix), it has already come up a few times, and I can imagine it being asked about more in the future.

viewtopic.php?f=3&t=24280

admin
Site Admin
Posts: 60644
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Scripts on buttons

Post by admin »

Do they? I think I fixed that some days ago.

jupe
Posts: 2811
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Scripts on buttons

Post by jupe »

Not fixed for me in .0106, it pops a menu like this:

viewtopic.php?p=196769#p196769

admin
Site Admin
Posts: 60644
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Scripts on buttons

Post by admin »

Ah, if it's the only item it indeed doesn't work yet.

jupe
Posts: 2811
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Scripts on buttons

Post by jupe »

Was it an intentional change to make word wrap always enabled when editing multi-line CTB's scripts now?

admin
Site Admin
Posts: 60644
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Scripts on buttons

Post by admin »

Not really. On 20220221 I went for a nicer dialog with header and icon, and did not think much about the word wrap. Actually I recycled some code from "Customize Menu..." in the Breadcrumb Bar, which is also always with word wrap enabled (but here the checkbox is not even shown so you cannot turn it off).

So, I guess the way to go is: Show the "word wrap" checkbox in both instances, and remember the setting. I think it's ok to share that setting between Breadcrumb Bar "Customize Menu..." and CTB "Edit...".

Post Reply