Also, I like the whole bold/check thing, very nice!
Icons in Scripts
Forum rules
READ THIS AND DO IT!!!
Please include the following information:
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).
We recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once.
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
READ THIS AND DO IT!!!
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).
Icons in Scripts
Latest additions to scripting sounds pretty cool (thanks for that!), but it's a little buggy as well. Seems that separators don't work after an item got an icon, instead a menu with a "-" as caption is shown, trying to exec script "-;" which obviously fails. Also, and I'm not sure why, but sometimes not only that but the icon isn't even shown, e.g. adding "|notepad" to the first item in one of my script works (except for breaking all my seps) but adding it later down in the menu, and the icon won't even show up (and all it does is break the seps).
Also, I like the whole bold/check thing, very nice!
Also, I like the whole bold/check thing, very nice!
Proud XYplorer Fanatic
-
admin
- Site Admin
- Posts: 65245
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Icons in Scripts
I will rewrite the bold/check thing in the next beta, so don't put too much work in it now.jacky wrote:Latest additions to scripting sounds pretty cool (thanks for that!), but it's a little buggy as well. Seems that separators don't work after an item got an icon, instead a menu with a "-" as caption is shown, trying to exec script "-;" which obviously fails. Also, and I'm not sure why, but sometimes not only that but the icon isn't even shown, e.g. adding "|notepad" to the first item in one of my script works (except for breaking all my seps) but adding it later down in the menu, and the icon won't even show up (and all it does is break the seps).
Also, I like the whole bold/check thing, very nice!
FAQ | XY News RSS | XY X
-
admin
- Site Admin
- Posts: 65245
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Icons in Scripts
This separator and Notepad works alright:
Please show code that does not work.
Code: Select all
"!Go C:\Temp|C:\Temp" goto "C:\Temp";
"Go Desktop|Desktop" goto "Desktop";
"Go XY exe|<xypath>\XYplorer.exe" goto "<xypath>\XYplorer.exe";
"-"
"Open With Photoshop|Photoshop" openwith "Photoshop";
"Open With Notepad|Notepad" openwith "Notepad";
FAQ | XY News RSS | XY X
Re: Icons in Scripts
Oh, sure, if you do things like that...
Thing is, AFAIC I don't think I ever put my separators into quotes, so I would have done this:
And sure enough, then it doesn't work...
Code: Select all
"!Go C:\Temp|C:\Temp"
goto "C:\Temp";
"Go Desktop|Desktop"
goto "Desktop";
"Go XY exe|<xypath>\<xyexe>"
goto "<xypath>\<xyexe>";
-
"Open With Photoshop|Photoshop"
openwith "Photoshop";
"Open With Notepad|Notepad"
openwith "Notepad";Proud XYplorer Fanatic
Re: Icons in Scripts
admin wrote:Please show code that does not work.
Code: Select all
"_noIcons" echo("Hasta la vista, icons! Mwahaha!");
"!Go C:\Temp|C:\Temp" goto "C:\Temp";
"Go Desktop|Desktop" goto "Desktop";
"Go XY exe|<xypath>\XYplorer.exe" goto "<xypath>\XYplorer.exe";
"-"
"Open With Photoshop|Photoshop" openwith "Photoshop";
"Open With Notepad|Notepad" openwith "Notepad";-
admin
- Site Admin
- Posts: 65245
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Icons in Scripts
I'm thinking about doing a third binary field Flags for these things:admin wrote:I will rewrite the bold/check thing in the next beta, so don't put too much work in it now.
Code: Select all
"Caption|Iconfile|Flags : Label" Script
where:
Flags 1 = Default
Flags 2 = Checked
Flags 4 = Disabled
FAQ | XY News RSS | XY X
-
admin
- Site Admin
- Posts: 65245
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Icons in Scripts
OK, fixed.jacky wrote:Oh, sure, if you do things like that...Thing is, AFAIC I don't think I ever put my separators into quotes, so I would have done this:
And sure enough, then it doesn't work...Code: Select all
"!Go C:\Temp|C:\Temp" goto "C:\Temp"; "Go Desktop|Desktop" goto "Desktop"; "Go XY exe|<xypath>\<xyexe>" goto "<xypath>\<xyexe>"; - "Open With Photoshop|Photoshop" openwith "Photoshop"; "Open With Notepad|Notepad" openwith "Notepad";
FAQ | XY News RSS | XY X
Re: Icons in Scripts
Honestly, I don't like all this overloading of the "Caption : label". We all said that the format of script files is flawed and not ideal anymore, so maybe it's time we considered a more structured approach?admin wrote:I'm thinking about doing a third binary field Flags for these things:admin wrote:I will rewrite the bold/check thing in the next beta, so don't put too much work in it now.It's cleaner, but maybe makes scripts a bit harder to read. Opinions please.Code: Select all
"Caption|Iconfile|Flags : Label" Script where: Flags 1 = Default Flags 2 = Checked Flags 4 = Disabled
Something that would allow us to use real sub-menus and didn't rely so heavily on white-space.
Re: Icons in Scripts
Thanks TheQwerty, I wasn't sure what made the icons go away.
Might be easier to read if you add constants, so one can use MNU_CHECKED or something instead of 2. (Plus, allow MNU_CHECKED + MNU_DISABLED of course)admin wrote:It's cleaner, but maybe makes scripts a bit harder to read. Opinions please.
Proud XYplorer Fanatic
-
admin
- Site Admin
- Posts: 65245
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Icons in Scripts
OK, fixed as well. (Good bug! Not directly in Script Icons, but only surfaced by means of them!)TheQwerty wrote:admin wrote:Please show code that does not work.Code: Select all
"_noIcons" echo("Hasta la vista, icons! Mwahaha!"); "!Go C:\Temp|C:\Temp" goto "C:\Temp"; "Go Desktop|Desktop" goto "Desktop"; "Go XY exe|<xypath>\XYplorer.exe" goto "<xypath>\XYplorer.exe"; "-" "Open With Photoshop|Photoshop" openwith "Photoshop"; "Open With Notepad|Notepad" openwith "Notepad";
FAQ | XY News RSS | XY X
-
admin
- Site Admin
- Posts: 65245
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Icons in Scripts
Go ahead, today seems to be your structured day!TheQwerty wrote:Honestly, I don't like all this overloading of the "Caption : label". We all said that the format of script files is flawed and not ideal anymore, so maybe it's time we considered a more structured approach?admin wrote:I'm thinking about doing a third binary field Flags for these things:admin wrote:I will rewrite the bold/check thing in the next beta, so don't put too much work in it now.It's cleaner, but maybe makes scripts a bit harder to read. Opinions please.Code: Select all
"Caption|Iconfile|Flags : Label" Script where: Flags 1 = Default Flags 2 = Checked Flags 4 = Disabled
Something that would allow us to use real sub-menus and didn't rely so heavily on white-space.
For starters, what about this (new keyword cmd to start a menu command); no more white space or indents necessary thanks to {...}:
Code: Select all
cmd label(caption, icon, flags) {script}FAQ | XY News RSS | XY X
-
j_c_hallgren
- XY Blog Master
- Posts: 5826
- Joined: 02 Jan 2006 19:34
- Location: So. Chatham MA/Clearwater FL
- Contact:
Re: Icons in Scripts
When I see "cmd", I tend to think of the command line and this is something else, so while having a named keyword makes sense, not sure if "cmd" is best one...maybe "menucmd" or "menuopt" or something along those lines?admin wrote:For starters, what about this (new keyword cmd to start a menu command); no more white space or indents necessary thanks to {...}:Code: Select all
cmd label(caption, icon, flags) {script}
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.
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.
-
serendipity
- Posts: 3360
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: Icons in Scripts
I agree, cmd is not the best.j_c_hallgren wrote:When I see "cmd", I tend to think of the command line and this is something else, so while having a named keyword makes sense, not sure if "cmd" is best one...maybe "menucmd" or "menuopt" or something along those lines?admin wrote:For starters, what about this (new keyword cmd to start a menu command); no more white space or indents necessary thanks to {...}:Code: Select all
cmd label(caption, icon, flags) {script}
Re: Icons in Scripts
I'm not in favour of flags, to be honest. Also, I'd prefer symbolic representation of menus, level of boldness etc, not word commands. Symbols (and combinations of) are shorter and thus easier to remember.
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build
Windows 7/10
Always using the latest stable two-decimal build
-
admin
- Site Admin
- Posts: 65245
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Icons in Scripts
The obvious other candidate is function.j_c_hallgren wrote:When I see "cmd", I tend to think of the command line and this is something else, so while having a named keyword makes sense, not sure if "cmd" is best one...maybe "menucmd" or "menuopt" or something along those lines?admin wrote:For starters, what about this (new keyword cmd to start a menu command); no more white space or indents necessary thanks to {...}:Code: Select all
cmd label(caption, icon, flags) {script}
FAQ | XY News RSS | XY X
XYplorer Beta Club