Minor scripting related wishes (a generic thread)

Features wanted...
highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Minor scripting related wishes (a generic thread)

Post by highend »

No other ways IMO
I've found one ;) Script was updated to include all properties of the closed tab(s).
Currently I have no time to add this stuff
K, maybe later...
One of my scripts helped you out? Please donate via Paypal

klownboy
Posts: 4109
Joined: 28 Feb 2012 19:27

Re: Minor scripting related wishes (a generic thread)

Post by klownboy »

Don, Would you be able to implement some method of detecting in a script whether a normal left click or a right click is used on a CTB? We've been discussing this topic in another thread here: http://www.xyplorer.com/xyfc/viewtopic.php?f=3&t=8917 Maybe this detection would be in the form of a variable (e.g., <LRclickCTB> = 1 or 2) or whatever you think best. There have been a number of discussions along these lines where the scripter might want to perform different or modified actions depending on whether a normal left click was used on the CTB or a right click. In some cases both the left and right click might result in having the same menu display and utilize the same (single) script file but different actions or options would be taken depending on whether a left or right click was performed. I think users could really take advantage and make good use of this change.

I'm not sure if the above change would fix this particular problem, but at this time it doesn't appear possible to open a script menu directly when it is executed by loading a script hidden label using a right click on a CTB. See the pics and discussion in the above link.

Along the same lines (involving the CTB, L & R click), I was also wondering if you'd consider implementing a request I mentioned about a half year ago here: http://www.xyplorer.com/xyfc/viewtopic.php?f=5&t=8231 Essentially it was to provide us a tweak or option to not have the "Click, Edit..., and Customize toolbar..." menu items display when you "right clicked" clicked the CTB. You can easily assess those menu items by holding down the control key with a right click anyway.
Thanks,
Ken
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

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

Re: Minor scripting related wishes (a generic thread)

Post by admin »

OK; I added this:

Code: Select all

    + New variable <get trigger> returns the action that triggered a 
      script:
        echo <get trigger>;
      Returned values:
        None = 0
        LeftClick = 1
        RightClick = 2
        MiddleClick = 4
      Notes:
      - The <get trigger> variable is cleared after the script is 
        processed.
      - Currently implemented only for Custom Toolbar Buttons.

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

Re: Minor scripting related wishes (a generic thread)

Post by admin »

I think the items "Click, Edit..., and Customize toolbar..." should always be available.

j_c_hallgren
XY Blog Master
Posts: 5824
Joined: 02 Jan 2006 19:34
Location: So. Chatham MA/Clearwater FL
Contact:

Re: Minor scripting related wishes (a generic thread)

Post by j_c_hallgren »

admin wrote:I think the items "Click, Edit..., and Customize toolbar..." should always be available.
From what I can see, they would still be available --but-- just not visible so I can agree with klownboy in his request and that not having click/edit seen all the time makes the CTB look more like a built-in button (though having "customize" could be left intact as that is visible on all TB buttons).
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Minor scripting related wishes (a generic thread)

Post by highend »

From what I can see, they would still be available --but-- just not visible so I can agree with klownboy in his request and that not having click/edit seen all the time makes the CTB look more like a built-in button
+10^^
One of my scripts helped you out? Please donate via Paypal

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

Re: Minor scripting related wishes (a generic thread)

Post by admin »

Ok :)

klownboy
Posts: 4109
Joined: 28 Feb 2012 19:27

Re: Minor scripting related wishes (a generic thread)

Post by klownboy »

Don,
Another small request. Well, hopefully it's small (there's much verbage below, but I'm just trying to explain myself as clearly as possible.) There's been much chatter lately on having an auto-executing section of a script such that we could set variables or whatever before a menu label is displayed. See this post http://www.xyplorer.com/xyfc/viewtopic.php?f=3&t=9028 It's come up many times before. It would be great to be able to display a menu label that contains information based on a variable or for example if I had left-clicked to enter the menu or right-clicked. There could be a work around until that happens by using load-script-label. However, when you use a load script with a script label in the CTB "On right-click:

Code: Select all

load "D:\Tools\XYplorer\Scripts\rightclicktest.xys", "_rightclicked";
You will always see the "_rightclicked" come up as a menu item first which you then have to click on to get the menu that you want to see. In other words on the right-click it doesn't auto execute the menu as it does when you do a standard left click on a menu loaded via the left click on a CTB.

Code: Select all

load "D:\Tools\XYplorer\Scripts\rightclicktest.xys", "_leftclicked";
Take this small example:

Code: Select all

"_rightclicked : _rightclicked";
   copytext "[with ToolBar]";
   load self(file);

"_leftclicked : _leftclicked";
  if (<get trigger> == 1) {
    copytext "[no ToolBar]";}
    load self(file);

"Wallpaper <clipboard>";
"Mountains|D:\Graphics\Icons\k321-icon-219.ico" goto "G:\Wallpaper\1920x1080\Mountains";
"Rivers && Streams|D:\Graphics\Icons\k321-icon-218.ico" goto "G:\Wallpaper\1920x1080\Rivers & Streams";
"Sun && Sky|:viewthumbs" goto "G:\Wallpaper\1920x1080\Sun & Sky";
"Trees|D:\Graphics\Icons\k321-icon-218.ico" goto "G:\Wallpaper\1920x1080\Trees";
When you rightclick you get this result:
rightclick_initial menu.JPG
rightclick_initial menu.JPG (11.35 KiB) Viewed 3171 times
You then have to click on "_rightclicked" to bring up the menu you want to display which is this:
rightclick menu.JPG
rightclick menu.JPG (13.69 KiB) Viewed 3171 times
When you do a standard left-click, this menu displays immendiately.
leftclick_menu.JPG
leftclick_menu.JPG (13.3 KiB) Viewed 3171 times
Could you make a change or tweak that would bring up the menu loaded via the the right click without seeing the intermediate "_rightclicked" menu? An auto-executing section of a script such that we could set variable prior to displaying a menu would be even better, but I think it would be great if we could eliminate the appearance of the intermedate menu in anycase.
Thanks ,
Ken
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

PeterH
Posts: 2776
Joined: 21 Nov 2005 20:39
Location: Germany

Re: Minor scripting related wishes (a generic thread)

Post by PeterH »

You remember that a script file is not just a script, but eventually a set of scripts, gathered together in one file?

Seen from this side your idea might be a bit problematic?

Especially as I often have scripts in a script file that are used as kind of subroutines for the other script(s). They, for example, should *not* be handled like the "main script(s)", I think.
W7(x64) SP1 German
( +WXP SP3 )

klownboy
Posts: 4109
Joined: 28 Feb 2012 19:27

Re: Minor scripting related wishes (a generic thread)

Post by klownboy »

I understand that scripts files are or can be multiple scripts. I use "sub" and "load" frequently in scripts, but I don't see why eliminating the appearance of the "intermediate" menu when calling a script label in the On right-click of a CTB as discussed above would affect typical scripting or be problematic. The sub(s) or scripts within the script file wouldn't be handled as a main script. This would only be applicable when we load a script with a menu with the load-script with label on a right click of a CTB. I'd perfer to have an auto-execute section which would allow us to establish variables prior to a menu display, but I see the above request as logical suggestion even if/when an auto-execute script section is incorporated at some point.
Thanks,
Ken
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

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

Re: Minor scripting related wishes (a generic thread)

Post by admin »

Auto-execute section sounds useful, but one has to see how this fits into the current architecture. My guess is that it will not be worth the pain.

PeterH
Posts: 2776
Joined: 21 Nov 2005 20:39
Location: Germany

Re: Minor scripting related wishes (a generic thread)

Post by PeterH »

admin wrote:Auto-execute section sounds useful, but one has to see how this fits into the current architecture. My guess is that it will not be worth the pain.
Just to ask: you think of fitting from position of XY-internal (i.e. your implementation), or for scripting logic?
W7(x64) SP1 German
( +WXP SP3 )

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

Re: Minor scripting related wishes (a generic thread)

Post by admin »

PeterH wrote:
admin wrote:Auto-execute section sounds useful, but one has to see how this fits into the current architecture. My guess is that it will not be worth the pain.
Just to ask: you think of fitting from position of XY-internal (i.e. your implementation), or for scripting logic?
Well, both. Form follows function.

Multiple scripts in one resource pop as a menu where you choose the script you want to run. This is the basic idea and everything is built on this fundament. Seeing the multiple scripts as functions within one master-script is tempting, but is a different idea. This would be a fundamental conceptual change. Not on my list right now.

PeterH
Posts: 2776
Joined: 21 Nov 2005 20:39
Location: Germany

Re: Minor scripting related wishes (a generic thread)

Post by PeterH »

admin wrote:
PeterH wrote:
admin wrote:Auto-execute section sounds useful, but one has to see how this fits into the current architecture. My guess is that it will not be worth the pain.
Just to ask: you think of fitting from position of XY-internal (i.e. your implementation), or for scripting logic?
Well, both. Form follows function.

Multiple scripts in one resource pop as a menu where you choose the script you want to run. This is the basic idea and everything is built on this fundament. Seeing the multiple scripts as functions within one master-script is tempting, but is a different idea. This would be a fundamental conceptual change. Not on my list right now.
Isn't this an argument *pro* the klownboy-request?
And thinking about this my restrictions become smaller and smaller!

Just as an idea:
- if a multiscript file ist loaded without specifying a label, or specifying a non-hidden label, a kind of pre-initialization function (as klownboy said) could be executed.
- if it's loaded specifying a hidden label ("_xxx") the initialization fuction should *not* be executed.

This way both worlds could simply coexist.
W7(x64) SP1 German
( +WXP SP3 )

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

Re: Minor scripting related wishes (a generic thread)

Post by admin »

Well, I tried to explain why exactly this is not easy to do because it runs against the fundamental idea. Believe me, it is not easy. Sorry, I have to move on now.

Post Reply