Scripting Bugs

Things you’d like to miss in the future...
Forum rules
:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:

:info: 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%).

:info: 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.

:info: When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".

:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:
admin
Site Admin
Posts: 65060
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Scripting Bugs

Post by admin »

Check your templates, maybe they start with "(2)"?

nerdweed
Posts: 648
Joined: 25 Feb 2012 07:47

Re: Scripting Bugs

Post by nerdweed »

Yes, they start with " (2)", but it should be used only on collisions.

If only one item is copied, it doesn't use the template. Similarly, if two items are copied and an item with the name doesn't exist, only one should be copied with the template

i.e.; Bold is unexpected behavior

if Funky.txt does not exist in D:\Demo\Fun
CopyAs "Funky.txt", "D:\Demo\Fun", "D:\Demo\New.txt" --Copies as Funky.txt - Good
CopyAs "Funky.txt", "D:\Demo\Fun", "D:\Demo\New.txt|D:\Demo\Old.txt" --Copies as Funky (2).txt and Funky (3).txt -- Wrong --Should be copied as Funky.txt and Funky (2).txt

if Funky.txt already exists in D:\Demo\Fun
CopyAs "Funky.txt", "D:\Demo\Fun", "D:\Demo\New.txt" --Gives me a collision prompt - OK
CopyAs "Funky.txt", "D:\Demo\Fun", "D:\Demo\New.txt|D:\Demo\Old.txt" --Copies as Funky (2).txt and Funky (3).txt -- Good

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

Re: Scripting Bugs

Post by admin »

This is by design. The resulting names are more consistent like this, and this is IMO preferable.

nerdweed
Posts: 648
Joined: 25 Feb 2012 07:47

Re: Scripting Bugs

Post by nerdweed »

It gives a feeling that one file was deleted

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

Re: Scripting Bugs

Post by TheQwerty »

Code: Select all

::Echo InputSelect(,'A|B|C',,16);
1) Drag C into position 2. (Making it: A|C|B)
2) Select C and hit OK.
3) It echos B instead of C.

It should return token 2 from the re-ordered list not the original list - just like it does if do the same but use:

Code: Select all

::Echo InputSelect(,'A|B|C',,2+16);
I fully realize using style 16 without style 2 is rather stupid but still...

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

Re: Scripting Bugs

Post by admin »

Yep, bug. :bug: Fix comes.

zer0
Posts: 2676
Joined: 19 Jan 2009 20:11

Re: Scripting Bugs

Post by zer0 »

Not sure if it's a bug or not, but it's definitely undesired behaviour.

Description: when having a multi-line piece of text -- not word wrap -- copied to clipboard, in-line rename pastes the whole thing joining the parts together (good), but the following scripting command fails with an error (bad).

Code: Select all

rename b, "<clipboard>";
Image
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

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

Re: Scripting Bugs

Post by admin »

Well, it might be a desired behavior. It's questionable whether this special feature of inline rename should be extended to scripting. Whatever, this is certainly not a bug.

zer0
Posts: 2676
Joined: 19 Jan 2009 20:11

Re: Scripting Bugs

Post by zer0 »

admin wrote:Well, it might be a desired behavior. It's questionable whether this special feature of inline rename should be extended to scripting. Whatever, this is certainly not a bug.
OK, it's not a bug. But in what situation could be the desired behaviour? If I copy a bunch of text to clipboard, I would expect that all of it is pasted wherever I designate. When needing to rename a bunch of files with different extensions to have the same base, the scripting command is very handy.
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

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

Re: Scripting Bugs

Post by admin »

Ah, works already! Simply use flag 16:

Code: Select all

rename b, "<clipboard>",,,16;
PS: Next beta will slightly improve the functionality of flag=16 so that it's 100% identical to pasting into the inline box.

zer0
Posts: 2676
Joined: 19 Jan 2009 20:11

Re: Scripting Bugs

Post by zer0 »

admin wrote:Ah, works already! Simply use flag 16:
Yes, indeed :appl:
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

Filehero
Posts: 2720
Joined: 27 Feb 2012 18:50
Location: Windows 11@100%

Re: Scripting Bugs

Post by Filehero »

SC folderreport wrongly adds an CR/LF after the last entry when parameter separator is left empty.

Just compare the two flavors

Code: Select all

text(folderreport("items:{name}","r",aPath,,,));
text(folderreport("items:{name}","r",aPath,,,"<crlf>"));
Cheers,
FH

PeterH
Posts: 2826
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: Scripting Bugs

Post by PeterH »

For a pure list it might be helpful to terminate *all* lines by crlf?

While the separator-operand explicitly states that separator is *between* the items. (I don't use the word 'lines' here :D )

So it might work as designed?
(I still hate IBM for this expression :oops: )

Filehero
Posts: 2720
Joined: 27 Feb 2012 18:50
Location: Windows 11@100%

Re: Scripting Bugs

Post by Filehero »

Hi Peter,

all formalisms aside, a loop over the resulting list should, nope, must have the same number of iterations, no matter wether default separation is used or not.

FH

PeterH
Posts: 2826
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: Scripting Bugs

Post by PeterH »

Maybe, if I didn't understand you wrong, you should just use separator <crlf>?

Again: I think it might have sense if both versions exist - and you con choose.
And then the version without sep are wrong for you :roll:

(To say: my interpretation :P )

Post Reply