Expandable drive button

Discuss and share scripts and script files...
serendipity
Posts: 3358
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Expandable drive button

Post by serendipity »

Filehero wrote:Hi,
serendipity wrote:What happens when you run this addressbar?

Code: Select all

run "cmd /c cd /d <xypath> & xyplorer.exe /script=""::msg 'Hi!';"" /flg=2", , 0,0; 
a new XY instance opens in the foreground which then creates the "Hi!" popup. What do you expect to happen?

Obviously I'm the only one having this problem. Strange.

Thanks for helping.


Cheers,
Filehero
Yes strange, the /flg=2 is supposed to send the script to the current instance of XY, not open a new one.
Could you tell what your xypath is? paste ::text <xy>; in AB.

Filehero
Posts: 2644
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: Expandable drive button

Post by Filehero »

serendipity wrote:Could you tell what your xypath is? paste ::text <xy>; in AB.
PMed.

serendipity
Posts: 3358
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Expandable drive button

Post by serendipity »

Filehero wrote:
serendipity wrote:Could you tell what your xypath is? paste ::text <xy>; in AB.
PMed.
Thanks!
Tried with the exact same path as yours and i cannot reproduce the new instance issue.
Maybe there is a setting i am missing that is doing this. Could you try this in another folder?

Filehero
Posts: 2644
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: Expandable drive button

Post by Filehero »

serendipity wrote:Could you try this in another folder?
Any 'another' one or do you have a specific location in mind?

Copying XY to E:\ and running from E:\XY\xyplorer.exe ends up still the same.

Maybe it is releated to Windows 8.1?

Since I'm the only one reporting this, we should leave it for now. I'll see what I can find out later this week.

Thanks so far. :)


Cheers,
Filehero
Last edited by Filehero on 21 Oct 2013 22:23, edited 1 time in total.

serendipity
Posts: 3358
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Expandable drive button

Post by serendipity »

Filehero wrote:
serendipity wrote:Could you try this in another folder?
Any 'another' one or do you have a specific location in mind?
Yes, if you don't mind doing these steps:
1) copy XYplorer.exe to another location.
2) Open Xyplorer.exe
3) Copy the script to Scripts folder
4) Add new ctb and add load "ExpandDriveButton.xys"; in edit field.
5) Change ctbindex in the script to 1 (if you added ctb1 that is)
6) Check Remember permanent variables (Refresh, Icons, History - Scripting)
7) Click on the new ctb to test script.

Thanks for your patience.

Filehero
Posts: 2644
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: Expandable drive button

Post by Filehero »

serendipity wrote: Yes, if you don't mind doing these steps:
1) copy XYplorer.exe to another location.
2) Open Xyplorer.exe
3) Copy the script to Scripts folder
4) Add new ctb and add load "ExpandDriveButton.xys"; in edit field.
5) Change ctbindex in the script to 1 (if you added ctb1 that is)
6) Check Remember permanent variables (Refresh, Icons, History - Scripting)
7) Click on the new ctb to test script.
I downloaded the script again and it works!!! :shock:

Than I copied that script file over into my dodgy installation and reconfigured $p_ctbindex - the 2nd instance is still opened. :veryconfused:

PV from 'broken' installation (button index #10 = "10")

Code: Select all

$p_toolbar = ctb10,,,,,,,,,back,fore,undo,redo,-,tpt,grid,ctb8,views,minitree,fp,openwith,-,myco,ctb11,rfo,hotlist,mru,favs,favfiles,-,find,cofi,visualfilter,qns,tsf,-,ctb4,ctb3,ctb2,-,ctb7,ctb9,ctb5,ctb6,ctb12
PV from fresh and working installation (button index #1 = "1")

Code: Select all

$p_toolbar = ctb1,,,,,,,,,,,,,,,,,,back,fore,up,mru,-,myco,newfolder,find,openwith,-,copy,cut,paste,del,-,undo,redo,-,tpt,cbx,grid,tsf,visualfilter,-,flatview,views,minitree,dp,dp12,-,qns,meta,fp,cofi,icf,conf
Further observations: I open the fresh XY from the 'broken' one. Toggling always works with the fresh one. However, when I focus the 'broken' one whereas the fresh one is still opened in the background the popup-ing is replaced by focusing the backgrounded fresh instance, followed by an scripting error
EDB_sc-error.png
EDB_sc-error.png (10.96 KiB) Viewed 3786 times
But this error is just secondary to the primary misbehaviour, I think.

I will continue tomorrow evening.


Cheers,
Filehero

Filehero
Posts: 2644
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: Expandable drive button

Post by Filehero »

Hi Ken,

oups, just noticed this kind offer now. :oops:
klownboy wrote:I can send you my version via PM if you want (I've been using it for a few weeks now without a problem)
Yes, I would like to know wether your version works in my 'broken' XY context.


Thanks, Filehero

serendipity
Posts: 3358
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Expandable drive button

Post by serendipity »

Updated first post. v2.2.
Script was adding extra commas unnecessarily.
Please do this once if you used v2.1:
1) Save current instance
2) Goto ini file and find Toolbar=
3) Delete extra commas and save ini file.
4) File>Restart without saving

Filehero
Posts: 2644
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: Expandable drive button

Post by Filehero »

Hi serendipity,

thanks for that update.
serendipity wrote:Updated first post. v2.2.
Script was adding extra commas unnecessarily.
Please do this once if you used v2.1:
1) Save current instance
2) Goto ini file and find Toolbar=
3) Delete extra commas and save ini file.
4) File>Restart without saving
A quick test in the morning showd no signs of improvement.

And this

Code: Select all

run "cmd /c cd /d <xypath> & xyplorer.exe /script=""::msg 'Hi!';"" /flg=2", , 0,0; 
still causes a new instance to come up.

My next steps:
1) Trying Ken's version (thanks again)
2) If there's still no change for the better
-> verifying it's one of my settings/configs (putting a fresh ini to my existing XY installation)
-> then, if still 'kaput', stepping through the config section-wise

This is starting to become really puzzling. :mrgreen:

Cheers,
Filehero

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

Re: Expandable drive button

Post by klownboy »

Hi Filehero and serendipity,
Could it possibly be the "cmd" that is causing the issue. I tried this in the AB and it worked.

Code: Select all

run "<xy> /script=""::msg 'Hi!';"" /flg=2", , 0,0; 
I even purposely changed the directory using "cmd" to <xyscripts> in lieu of <xypath> beforehand with this and it still worked.

Code: Select all

::text <xy>;run "cmd /c cd /d <xyscripts> & <xy> /script=""::msg 'Hi!';"" /flg=2", , 0,0;
Then I plugged this into the script and it also worked

Code: Select all

  run "cmd /c ping -n $collapse 127.0.0.1 >nul & <xy> /script=""::load 'ExpandDriveButton.xys','_WaitCollapse'"" /flg=2", , 0,0; 
Of course if the issue is strickly "/flg=2" parameter causing the 2nd instance of XY this wouldn't help in solving the problem, but I'd try the lines above just to see if it changes your result.
Ken
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

serendipity
Posts: 3358
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Expandable drive button

Post by serendipity »

klownboy wrote:Hi Filehero and serendipity,
Could it possibly be the "cmd" that is causing the issue. I tried this in the AB and it worked.

Code: Select all

run "<xy> /script=""::msg 'Hi!';"" /flg=2", , 0,0; 
Actually i did try using just run originally but it did not work for me and i resorted to cmd instead.
It still doesnt work for me on my XP setup here.
Which is your OS?

And the issue with the new instance i guess is got to do with Filehero's setting which you and me dont have i think. Because on new setup it seems to be working for him, if i understood correctly. Is this true Filehero?

Filehero
Posts: 2644
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: Expandable drive button

Post by Filehero »

Hi there,

just got home from work - just to find another spreadsheet awaiting final polishing. :veryconfused:
serendipity wrote:Is this true Filehero?
Absolutely. My flawed setup seems to be undependant of the home location, whereas a fresh install works everywhere including the original location.

My current plans are:
0) leaving bread crumbs being bread crumbs.

1) Checking all commands Ken kindly has prepared and posted.
All three command lines create new instances with my broken setup (XY was restarted before every test run) in contrast to the fresh installation (whose home directory is sharing the same parent folder, btw).

Additional note

Code: Select all

run "cmd /c ping -n $collapse 127.0.0.1 >nul & <xy> /script=""::load 'ExpandDriveButton.xys','_WaitCollapse'"" /flg=2", , 0,0;
results in a "Invalid button index: 0" SC error in either case. Because of the latter I consider this finding unrelated to my problem.[/color]


Now, I just list the "if it is still broken" routes
2) Checking Ken's derivative script he sent me
The same procedure. My 666 installation popups a new instance upon click for expansion, the fresh one works as expected. Now, let's face it ......

3) Trying to isolate the XY data file hosting that haunting evil
Just flipping the ini files either way (fresh to 666) indicate it's indeed the cumulative essence of my XY history which ist to blame for. Now it's starting to become lengthy, I guess.

4) If it's the XY ini (this is what I'm afraid of) narrowing down further sectionwise (happy Beyond Comparing)
  • - well, it's not my license :lol:



#---------------------------------------- have I found the cause? ------------------------------------#
After going through all XY ini sections constituting 1440 lines in total, doing way more than 100 XY 'Restart without Saving' I think I got it!

With a fresh XY ini I could invoke the problem of a popping second XY instance by replacing the original setting

Code: Select all

TitlebarTemplate="<path> - <app> @ <ini> - <ver>"
with my customized one

Code: Select all

TitlebarTemplate="<xypath>:<app> (<ver>)   |   <path>"
A couple of dozens minutes ( :lol: ) later I've isolated the following combinations of values for the title bar.

Harmless

Code: Select all

<xypath>:<app> @ <ini> | <ver>
<xypath>:<app> <ini> | <path>
<xypath><ver>
:<ver>
<ver>
. :<ver>
<app> <ver>
<ver> <app>
<app>
EVIL

Code: Select all

<xypath>:<app> @ <ver> | <ver>
<xypath>:<app> <ver> | <path>
<xypath>:<app> <ver> |
<xypath>:<app> <ver>
:<app> <ver>
:<app><ver>
<app><ver>
<ver><app>
AAAAAA<ver><app>BBBBBBB
:shock: :shock:

The only pattern I can see so far is, that <app> and <ver> are required in the constitution the problem. I still think it's abolutely strange that a window title is involved, but I have done enough tests and controls.


Now I want to know: is it reproducible for you?

Follow up thread

#-----------------------------------------------------------------------------------------------------#

5) Let's wait and see

I'll think I will just edit this post to keep you updated (might take another evening :mrgreen: ).


So, lay back and relax, the next steps are up to me. :wink:

But before I drop my boring "Cheers,..." let me re-state one thing:
I'm really happy to be part of the XY beta club. This is one of the most distinguished and helpful communities I've ever happened to join. The commitment and helpfulness found in most of the posts is nearly second to none. I don't like name dropping, but those representing this spirit paradigmatically also have been showcasing in this thread. :D :D :appl: :appl:


Cheers,
Filehero
Last edited by Filehero on 24 Oct 2013 22:14, edited 8 times in total.

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

Re: Expandable drive button

Post by klownboy »

I'm running Windows 7 x64. It also works in Windows 8 x64. For your info, I tried

Code: Select all

run "<xy> /script=""::load 'ExpandableCTB.xys','_AutoCollapse'"" /flg=2", , 0,0; 
for the AutoCollapse command line and it works as well. However, I get that hourglass cursor that I've run into many times before when using the "/flg=2" paramenter. I never did figure out what causes that. It stays as a hourglass style cursor for 4 or 5 seconds before it stops and returns to the normal cursor. It's a little annoying in that it gives the appearance that something is wrong or slow, but it really isn't. I don't get the annoying hourglass cursor when I use your original line for Auto Collapse

Code: Select all

run "cmd /c cd /d <xypath> & xyplorer.exe /script=""::load 'ExpandableCTB.xys','_AutoCollapse'"" /flg=2", , 0,0; 
Any ideas on what might cause that? All you are doing with the "cmd /d" is changing the drive and directory to <xypath>, but for whatever reason it fixes the issue with the hourglass cursor.
Thanks,
Ken

Edit: Sorry, I think I was misreading the cmd line, in that I didn't realize initially that your "cmd" was also running XYplorer not just the "cd /d <xypath>" command (i.e., the use of the "&" is for "cmd" not "run". So that may be the reason the line with cmd doesn't get the hourglass cursor whereas the first line above does. Running the following line in AB works, but gives me the hourglass for a number of seconds.

Code: Select all

::run "<xy> /script=""::msg 'Hi!';"" /flg=2", , 0,0;
Whereas, running this with cmd running XY, I get no hourglass.

Code: Select all

::run "cmd /c <xy> /script=""::msg 'Hi!';"" /flg=2", , 0,0;
Now, I'm really wondering if that is something Don could fix...
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

serendipity
Posts: 3358
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Expandable drive button

Post by serendipity »

@Filehero:
Don't know what's special about your config, but could you play with multiple instance options in "Startup & Exit" config? Not sure if that helps.
And thanks for the kind words. :)

@klownboy: Not sure if there is anything for Don to fix, given that it does not happen on fresh install for Filehero.
The reason i added cd /d is because when i initiate command from non-C drive i had problems, so left it as it is now.
And that hourglass cursor is strange not seen that here.

Filehero
Posts: 2644
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: Expandable drive button

Post by Filehero »

Hi serendipity,

I have no idea, what is or could be going on here, it doesn't seem to make any sense to me. But I will finish this test so that I have checked every single config item. :lol:

But since it's boring I've just decided to extend my break a little bit. :mrgreen:


Cheers,
Filehero

Post Reply