FavFolder GUI dialog

Discuss and share scripts and script files...
Stef123

FavFolder GUI dialog

Post by Stef123 »

I wouldn't know how to pull it off myself, so I am posting this as a scripting challenge to the friendly gurus out there.

Task: Create a favorite folder and ask user for a name
It then enters that name into #612 semi-automatically to avoid the long cryptic full path names XY defaults to. Saves me the hassle to call up list mgmt and click EDIT and add the quotes and caption.

Ideally, it would even sport a checkbox that stores dual pane locations if enabled. And leave #612 open with the new entry highlighted, to allow the user to move it up or down and finalize it.

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: FavFolder GUI dialog

Post by bdeshi »

Not possible with native XY scripting. But here's a hack.
The usual opeartion: go to the target folder to favorite, and instead of using Favorites > Toggle favorite folder, call supplied FavDirList.xys.
First set up correct paths in the xys, and set the btnTxt variable in the AHK if needed.
FavDirList.zip
The ahk is quite slow. I don't know why.
To see the attached files, you need to log into the forum.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

klownboy
Posts: 4459
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8037 at 100% 2560x1440

Re: FavFolder GUI dialog

Post by klownboy »

Hi Sammay, maybe a stupid question, but I was curious why you said it's not possibly with only XY scripting. Not that I tried anything myself - no time today. The Favorite Folders are listed in the XY's ini file, [Favorites], exactly as they appear in List Management. So why couldn't we have a script that does it all and not involve AHK? Use the <curpath> or go to a path if one is not selected, SC inputfolder, ask for a name and make entries in XYplorer.ini, save config, etc.
Thanks,
Ken

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: FavFolder GUI dialog

Post by bdeshi »

klownboy wrote:Hi Sammay, maybe a stupid question, but I was curious why you said it's not possible with only XY scripting.
Well, I meant there's no easy way. With scripting you have restart XY everytime you add a favorite scriptically. :blackstorm: To make the change visible.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

klownboy
Posts: 4459
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8037 at 100% 2560x1440

Re: FavFolder GUI dialog

Post by klownboy »

Hey Sammay thanks, I figured a save but didn't think about restart and I like that word "scriptically". :)

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: FavFolder GUI dialog

Post by bdeshi »

then you'll love this: always "availiable" to help! :mrgreen:
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Stef123

Re: FavFolder GUI dialog

Post by Stef123 »

Thanks Sammay,
still trying my green horns on it. Adjusted the paths to point to my portable ahk.exe - and :idea: eureka - it works just as expected. The inputbox for the name comes up instantly, same with list mgmt. Then however it really does take considerable time before the new path is ready to be moved into place. I wonder if it were faster by not offering me the list dialog, if the script simply went ahead and put it at the bottom or top?

In any case, even with the delay it is much better than fumbling in those quotes and captions manually. I feel tempted to try my hands on a second version that handles dual paths, once I understand how you pulled off the path components in the first place? Could you give me some pointers, what to read about in scripting help?
Many thanks for now
Stef

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: FavFolder GUI dialog

Post by bdeshi »

now with dual path support! a checkbox in addition to the caption input, and if it's checked, store both pane paths as a single favorite entry with DUAL: .
FavDirList.zip
[Set up again.]
To see the attached files, you need to log into the forum.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

klownboy
Posts: 4459
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8037 at 100% 2560x1440

Re: FavFolder GUI dialog

Post by klownboy »

Hi Sammay, I got a chance to try your new version this morning. Very nice and worked great! :appl: Not much for documentation obviously for Dual, but a nice trick - you can assign an icon to the Favorite Folders with the same syntax as PFA items. Not required usually for normal Favorite Folders since they'll use the customized file icon, but with Dual you can deviate from the plain Jane icon.
DUAL_Capture.PNG
It might make a nice future update. I tried adding a pipe separator and icon name to the name but the quoting end up being messed up.
Thanks,
Ken
To see the attached files, you need to log into the forum.

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: FavFolder GUI dialog

Post by bdeshi »

Thanks.
Cool Trick.
klownboy wrote:I tried adding a pipe separator and icon name to the name but the quoting end up being messed up.
I tried just now and the quotes and icon preview are OK. But I did see misplaced quotes once. (maybe AHK SendInput was too fast.) Did you try again? The issue might go away...
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

klownboy
Posts: 4459
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8037 at 100% 2560x1440

Re: FavFolder GUI dialog

Post by klownboy »

Yes Sammay, I tried again and this time the syntax was correct and the icon displayed properly for the DUAL Favorite Folders. Maybe it was an AHK speed issue.

However I did notice that an icon setup for the normal NON-DUAL folders does not work in XY. This is not an issue with your script, but an XYplorer issue in that the icons set for Customized File Icons takes precedence over the icon associated with the Favorite Folders. We had a similar issue a while back where they took priority over the established Tab icon in the tab "rename" edit box. I would consider this a bug. Give it a try.
Thanks

Stef123

Re: FavFolder GUI dialog

Post by Stef123 »

THANK YOU, Sammay. :tup: :beer:
Dual works great, now this dialog has become a full-blown GUI feature. There is no way I could have pulled it off myself. Still racking my brain about that second part in the ahk file, titled "MsgToXY()" - can you give me a hint what this does?
klownboy wrote:icon setup for the normal NON-DUAL folders does not work .... I would consider this a bug.
You have to hardwire it, the complete path, or use the built-in icons via "|:udc" syntax.
I also think it's a bug, even reported it, back when I started out with favfolders.
But then again, I have always been very unsure about syntax issues in general. In a CTB dropdown menu I always have to prefix <xyicons>\ - but this is not necessary for the CTB itself - inconsistencies like these can drive you nuts when you start out, and at some point I simply decided to always use the more elaborate alternative. With favfolder icons however, the hardwiring renders them invalid for portable use. :evil:

klownboy
Posts: 4459
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8037 at 100% 2560x1440

Re: FavFolder GUI dialog

Post by klownboy »

Hi Stef123, I discovered why I wasn't seeing the proper icon assigned. You are right about the syntax, but I was looking at the Favorite Folders via CleanRecent_v2.xys http://www.xyplorer.com/xyfc/viewtopic. ... NT#p103649 where I had done a mod to it which show the Favorite Folders and Favorite Files along with the recent files. I found out when I looked at the Favorite folders via it's own toolbar button it shows the proper assigned icon but not via the at CleanRecent menu even after saves and restarts. So I'll have to take a closer look at it to see why. Thanks.

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: FavFolder GUI dialog

Post by bdeshi »

Stef123 wrote:THANK YOU, Sammay. :tup: :beer: Still racking my brain about that second part in the ahk file, titled "MsgToXY()" - can you give me a hint what this does?
My pleasure :) and MsgToXY() is a function that just sends messages via Windows messaging to the calling/parent XYplorer detected with <hwnd>; [and it's part of bin222's AHKMessenger] In this case, it's used to send #612; (open list mgmt > fav folders)
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Stef123

Re: FavFolder GUI dialog

Post by Stef123 »

Thanks again Sammay,
one of these days I really should immerse myself into xys and ahk. Over the months it sank down to the bottom of my todo list. Always something that comes up with more immediate rewards. Scripting takes a lot of cross-reference reading for me, I never get very far before I have to jump to a related topic and to another one....

@Ken,
I remember your cleanrecent mod - the only reason I stick with the original classic version and don't combine it with favs files an folders = I have way too many entries, in all 3 lists. Your hint was good reminder though, that my recent button is not the default one, it has a script attached to it. Like many other great features, I owe it to you guys out there in the scripting community. Really, this whole XY experience is one amazing team effort of contributing developers. :tup: :appl: :arrow: 135 files in my \Data\Scripts folder :!:

Post Reply