HideUnderscoredUDCs=1 Tip

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
klownboy
Posts: 4462
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440

HideUnderscoredUDCs=1 Tip

Post by klownboy »

Hi,

In a post by TheQwerty under scripts, Tips: Managing your scripts, it discusses using the underscore to hide the UDC command from the UDC menu...

" •Sometimes you may want to manage a script but do not want to unnecessarily clutter up your User Menu, in that case set the 'HideUnderscoredUDCs' INI tweak to 1 and you will be able to prefix the caption with an underscore ('_Execute Greeting.xys'), telling XY to hide it from the menu, but maintaining the command ID and ability to customize its shortcut."

As stated above, it says you have to change the line item discussed in xyplorer.ini to "1" from "0". When I did this it doesn't seem to want to stick (i.e, it reverts back to 0) for some reason. I was doing it from within xyplorer using the "open configuration file" under "tools". When I did it and saved the file (by the way, I'm using "textpad" set as default), I was able to change it, but when I went to open xyplorer, it didn't recognize me as a registered user (which I am, lifetime) and the xyplorer had a black background and of course none of my settings were there. I did have a backup ini file luckily which I copied into the xyplorer folder and it then opened just fine. Is there some reason or setting I'm not aware of that's not permitting the manual change to the ini file? Concerning the particular trick mentioned above, I was also wondering if that tip will work for a script incorporated right in the UDC Managing commands multi-line script section as well as in a called out script file in the script directory?

Thanks,
Ken

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

Re: HideUnderscoredUDCs=1 Tip

Post by admin »


TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: HideUnderscoredUDCs=1 Tip

Post by TheQwerty »

If the directions Don linked to don't help then it's probably because TextPad is unfortunately still* behind the times with regard to how it handles Unicode.

After opening the file go to View > Document Properties.
On the Preferences tab make sure "Write Unicode and UTF-8 BOM" is checked.
20120313-150411 - Screenshot.png
OK
Now when you save the INI file, XY should be able to read it again.


Even more unfortunately that setting won't be remembered, so to have it always enabled you need to go into TextPad's Preferences and modify that setting for every class which needs it enabled. I don't recall if INI is an included class or one I made myself. :?

* Truth be told I haven't upgraded away from 4.7.3 so maybe it has gotten better but last time I checked it hadn't.


EDIT:
Concerning the particular trick mentioned above, I was also wondering if that tip will work for a script incorporated right in the UDC Managing commands multi-line script section as well as in a called out script file in the script directory?
It should work for all UDC items even the non-scripting ones.

Also, if you don't want to change your TextPad settings there's some scripting options too:

Code: Select all

#193;WriteFile("<xydata>\<xyini>", Input("<xydata>\<xyini>",,ReadFile("<xydata>\<xyini>"),'m'));#190;
or

Code: Select all

#193;SetKey(1, 'HideUnderscoredUDCs', 'Settings');#190;
#190 is File | Restart without Saving; #193 is File | Save Configuration.
To see the attached files, you need to log into the forum.

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

Re: HideUnderscoredUDCs=1 Tip

Post by klownboy »

Hi again,
Thanks for the input. I had already tried the recommendation link posted by Don, saving the ini file and exiting xyplorer without saving. It didn't work and I was actually starting to suspect that maybe "textpad" may have something to do with the problem. That's why I mentioned using it. So I set windows notepad as the default for ini files and tried it again and low and behold, it worked. Thanks Don and TheQwerty for your help and thanks for the scripts as well incase the other methods didn't work. As you said, the underscore tip did work, by the way, for scripts incorporated in the UDC Managing commands multi-line script section as it does for script files.
Thanks again,
Ken

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: HideUnderscoredUDCs=1 Tip

Post by TheQwerty »

klownboy wrote:It didn't work and I was actually starting to suspect that maybe "textpad" may have something to do with the problem. That's why I mentioned using it. So I set windows notepad as the default for ini files and tried it again and low and behold, it worked.
For your own information, I do use TextPad 4.7.3 to edit my XY configuration so it is possible to get it working.

I think the info in my previous post was all I had to do to configure TextPad correctly though it's possible I may have forgotten some other details. :?

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

Re: HideUnderscoredUDCs=1 Tip

Post by klownboy »

I didn't want to abandon textpad. It's actaully a nice little editor. I used notepad just to try the underscore tip out quickly. I since went back to textpad and made the unicode changes you described. There is no separate document class for "ini" files. There was a "text" document class that included ini, txt and bat files, etc. There was also another setting further below the one you pointed out that I was wondering if I should change. It is, A Default encoding: Ansi, Dos or UTF-8. Ansi is checked I suppose by default. Anyway, regardless of that particular setting the other change fixed my issue.
Thanks again,
Ken

Post Reply