Scripting Bugs

Things you’d like to miss in the future...
SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: Scripting Bugs

Post by SkyFrontier »

admin wrote:Confirmed! You have a good run today...
Cool. But please, what about this? http://www.xyplorer.com/xyfc/viewtopic. ... 60#p101274
I can't pass standard itemlists to report() other than 0 or 1.
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

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

Re: Scripting Bugs

Post by admin »

SkyFrontier wrote:

Code: Select all

 step;
   $inp = folderreport("files:{fullname}", "r", , "", , "|");

   $input = trim("$inp", "|");

   $input = report("{custom 2} = {fullname}|", "$input"); // custom 2 won't be caught
   $a = report("{custom 2} = {fullname}|", 0); // correct
beta 0113.
Yes, there is a problem. Fix comes.

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

Re: Scripting Bugs

Post by TheQwerty »

Floor and Ceiling do not like negative numbers...

Code: Select all

echo floor(-3.7); //Docs say it should be -4; I get -5.
echo ceil(-3.2);  //Docs say it should be -3; I get -4.
Various Info wrote:XYplorer: 13.80.0124 (Pro Edition - Lifetime License Pro)
Loaded in: 819 ms at 3/19/2014 2:20:32 PM
Uptime: 1 hr, 9 mins, 23 secs
Memory Usage: 36,252 KB, Virtual Memory Size: 16,528 KB

OS: Windows 7 Professional (Service Pack 1), 64-bit (6.1)
OS Uptime: 42 days, 2 hrs, 14 mins, 15 secs
UTC Offset: --04:00
User Role: User
Themes: Yes (Aero) RealSystem32: Yes

System Locale ID: 1033 (en-US)
Thread Locale ID: 1033 (en-US)
Default ANSI Code Page: 1252 (ANSI - Latin I)
Active Code Page: 1252 (ANSI - Latin I)
DBCS Code Page: No

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

Re: Scripting Bugs

Post by admin »

Indeed!

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

Re: Scripting Bugs

Post by zer0 »

Code: Select all

rename b, "<clipboard>", , , 4, "";
The above does not work as intended if clipboard text contains "/" illegal character. What happens in reality is that the file selected is renamed with clipboard content to the left of the forward slash with loss of extension even when "Exclude extension on rename" is checked. The correct approach, as you would hopefully agree, is to rename the file and replace the illegal char with nothing. renameitem() doesn't do the trick here either, because it complains about an illegal char.
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: 60588
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Scripting Bugs

Post by admin »

This is because "/" is the character that marks switches. So there is an unsolvable ambiguity. I don't see what I could do. Apart from a new function RenameCleanName() that would clean the input before passing it to rename.

Code: Select all

rename b, RenameCleanName("<clipboard>"), , , 4, "";
Or, more comfortable, a new flag for this:

Code: Select all

rename b, "<clipboard>", , , 16, "";

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

Re: Scripting Bugs

Post by zer0 »

admin wrote:Or, more comfortable, a new flag for this:

Code: Select all

rename b, "<clipboard>", , , 16, "";
This one looks good to me: keeping it simple should reduce chances of error make it easier to document.
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

eil
Posts: 1622
Joined: 13 Jan 2011 19:44

Re: Scripting Bugs

Post by eil »

didn't want to create a thread, maybe i'm stupid.. updated to 13.90 and wanted to add a button for tree:

Code: Select all

Snip: CTB 1
  XYplorer 13.90.0000, 31.03.2014 16:07:28
Action
  NewUserButton
Name
  Tree
Icon
  :maxitree
ScriptL
  #249;
ScriptR
  #583;
FireClick
  0
but it keeps saying "Command ID #249 does not exist!" and same for other../
Win 7 SP1 x64 100% 1366x768

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

Re: Scripting Bugs

Post by TheQwerty »

eil wrote:didn't want to create a thread, maybe i'm stupid.. updated to 13.90 and wanted to add a button for tree:

Code: Select all

Snip: CTB 1
  XYplorer 13.90.0000, 31.03.2014 16:07:28
Action
  NewUserButton
Name
  Tree
Icon
  :maxitree
ScriptL
  #249;
ScriptR
  #583;
FireClick
  0
but it keeps saying "Command ID #249 does not exist!" and same for other../
XY speaks the truth, I do not see commands #249 or #583.

Where did you find these ID numbers?
What commands are you actually trying to trigger?

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Scripting Bugs

Post by bdeshi »

@Eli, perhaps you're using the command order number in the list instead of of it's ID:
The #numbers are id
Attachments
id&order.png
id&order.png (30.48 KiB) Viewed 2317 times
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

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

Re: Scripting Bugs

Post by TheQwerty »

SammaySarkar wrote:@Eli, perhaps you're using the command order number in the list instead of of it's ID:
The #numbers are id
Good thought!

The list of all commands was recently changed to no longer show the command IDs by default.
To make them visible you have three options:
  1. Hold Ctrl while selecting List All Commands...
  2. Use the Jump... list from the Customize Keyboard Shortcuts dialog instead.
  3. Set the new INI tweak, HelpListOfCommandsWithIDs to 1 to restore the old behavior.

eil
Posts: 1622
Joined: 13 Jan 2011 19:44

Re: Scripting Bugs

Post by eil »

oh, i missed this change.. :eh: i really was trying to use # from grey collumn(marked with red).
SammaySarkar, TheQwerty, thank you for clearance and salvation options. :D

add: what was the reason for such change? and why it's not really marked as a tweak in ini?..
Win 7 SP1 x64 100% 1366x768

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

Re: Scripting Bugs

Post by TheQwerty »

eil wrote:add: what was the reason for such change? and why it's not really marked as a tweak in ini?..
It originated here and the tweak was requested here.

Boils down to reducing clutter - especially in the free edition where scripting is not available, rendering command IDs useless.

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

Re: Scripting Bugs

Post by zer0 »

Today, I came across some unwanted behaviour: it turns out that using the below scripting command would cause all subsequent queued XYcopy operations to remain queued until "Close" was clicked on the progress dialogue final status window.

Code: Select all

backupto "<location1>", "<location2>", 3;
This poses a problem for several reasons:
1. There is no scripted way to auto-click close on completion (if you just wanted to see the progress dialogue while a copy was taking place).
2. This happens even if backupto was completely successful (understandable if there were failures, since you may want to have users explicitly acknowledge that they saw errors).
3. It imposes inconvenience of having to plan one's sequence of XYcopy operation so that backupto happens last in order to avoid holding things up.

Granted, this may not be a scripting issue a 100%, but it involves a scripting operation and resolution will probably be easier via an additional scripting flag.
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: 60588
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Scripting Bugs

Post by admin »

It might be unwanted by you, but IMO it is what one would expect (and, for hypothetic other users, also want) to happen.

Post Reply