That's now really a bug, more like inconsistency. "On Delete Remove Items from Paper Folder" is logical and handy option, if i use delete key it only removes item = doesn't delete file in actual source(that's just to remind). So i presume that with this option ON, XY operates any own delete operation(surely excluding system context menu item) as "remove, not delete" = 'cause when i press Delete button on keyboard, that's XY making delete and remembering that in paper folders it's only remove.
Well, apparently for scripting XY doesn't honour "remove" option. I use special delete script, that makes extra checks before deletion and afterwards uses XY delete scripting command = which as uncovered Actually deletes files in original locations.
Not a huge deal, but either it must be mentioned in Help file paper folders chapter, that scripts can destroy your files structure unintentionally through paper folders, or scripting delete command should be enhanced.
Paper Folder "On Delete Remove Items" scripting corelation.
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 strongly 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, and we won't have to search for that vital information.
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%).
-
eil
- Posts: 1887
- Joined: 13 Jan 2011 19:44
Paper Folder "On Delete Remove Items" scripting corelation.
Win 7 SP1 x64 100% 1366x768|1900x1080
-
admin
- Site Admin
- Posts: 66619
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Paper Folder "On Delete Remove Items" scripting corelation.
Do you have an example script? I wonder how you reference the paper folder file you want to remove.
FAQ | XY News RSS | XY X
-
eil
- Posts: 1887
- Joined: 13 Jan 2011 19:44
Re: Paper Folder "On Delete Remove Items" scripting corelation.
Here's the script i'm using. It's originally made for all the checks and the deletion is simply at the very end by delete 1, 0, $selected;. As simple Delete shortcut is handled by XY and it takes in consideration "no-delete but remove" setting, i'd expect own scripting Delete function to do the same.
BTW, would be great if confirm() gets icons parameter like msg().
BTW, would be great if confirm() gets icons parameter like msg().
Win 7 SP1 x64 100% 1366x768|1900x1080
-
admin
- Site Admin
- Posts: 66619
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Paper Folder "On Delete Remove Items" scripting corelation.
Should work as desired in next beta.
FAQ | XY News RSS | XY X
-
admin
- Site Admin
- Posts: 66619
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
-
eil
- Posts: 1887
- Joined: 13 Jan 2011 19:44
Re: Paper Folder "On Delete Remove Items" scripting corelation.
I really liked the changelog and thank you for adding icon parameters, but for some reason i can't try either - my script just stopped deleting at all and icon parameter doesn't seem to work.(example: confirm($ques, , 2, 4, 48)) May it happen you uploaded wrong archive?
Win 7 SP1 x64 100% 1366x768|1900x1080
-
admin
- Site Admin
- Posts: 66619
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Paper Folder "On Delete Remove Items" scripting corelation.
No, both works. Your confirm syntax is wrong. Maybe your delete syntax is wrong, too? 
PS: However, there is a bug in the return of confirm. Fix comes.
PS: However, there is a bug in the return of confirm. Fix comes.
FAQ | XY News RSS | XY X
-
eil
- Posts: 1887
- Joined: 13 Jan 2011 19:44
Re: Paper Folder "On Delete Remove Items" scripting corelation.
Return was the reason, on new beta script works again. Yet fixed my syntax, but please make couple examples with new icons when you'll update the help file.
BTW, it's cool that when specifying exclamation icon it actually makes Windows to play a sound, like with system own menus!
Buuut for some reason script still deletes an actual file from paper folder instead of removing it, though i'm using simple delete 1, 0, $selected;. May it be the problem is in var initiation?
$selected = ($focus == 'T') ? <curpath> : ( ($focus == 'L') ? get('SelectedItemsPathNames', '|') : '' ) ;
Last edited by eil on 08 Sep 2022 15:21, edited 1 time in total.
Win 7 SP1 x64 100% 1366x768|1900x1080
-
eil
- Posts: 1887
- Joined: 13 Jan 2011 19:44
Re: Paper Folder "On Delete Remove Items" scripting corelation.
Need some help with reasons above.
Win 7 SP1 x64 100% 1366x768|1900x1080
-
LittleBiG
- Posts: 1848
- Joined: 08 Apr 2011 12:57
- Location: Win10x64
Re: Paper Folder "On Delete Remove Items" scripting corelation.
There is no problem with your initiation. When you name explicit items to delete in the itemlist, always the normal delete will happen. According to the changelog, remove from paper folder works only if the files are selected in the actually shown paper folder. So I suggest to use
selectitems $selected; first, then delete 1,0,":list" instead of your original delete 1, 0, $selected; command.Try this out and you will see the difference.
Delete:
Code: Select all
$selected=<curitem>; delete 1,1,$selected;Code: Select all
$selected=<curitem>; selectitems $selected; delete 1,1,":list";-
eil
- Posts: 1887
- Joined: 13 Jan 2011 19:44
Re: Paper Folder "On Delete Remove Items" scripting corelation.
Guess i finally understood how this magic works after some experiments, and the problem actually Was in var initialization - variable got a list of actual pathes which delete handled as ordinary items from list to be deleted. I actually expected paper folders give back info in some "other foemat"(smth like "paper:Run.exe"), and thought delete just interprets it into real path(that's why asked for improvement, but it appears quite different tricks are used).
Oh well, at least now i know how to make things working, though using delete in paper folders is still tricky.
Oh well, at least now i know how to make things working, though using delete in paper folders is still tricky.
Win 7 SP1 x64 100% 1366x768|1900x1080
XYplorer Beta Club