Page 1 of 1

Paper Folder "On Delete Remove Items" scripting corelation.

Posted: 05 Sep 2022 14:58
by eil
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.

Re: Paper Folder "On Delete Remove Items" scripting corelation.

Posted: 06 Sep 2022 08:44
by admin
Do you have an example script? I wonder how you reference the paper folder file you want to remove.

Re: Paper Folder "On Delete Remove Items" scripting corelation.

Posted: 06 Sep 2022 12:20
by eil
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().

Re: Paper Folder "On Delete Remove Items" scripting corelation.

Posted: 06 Sep 2022 17:50
by admin
Should work as desired in next beta.

Re: Paper Folder "On Delete Remove Items" scripting corelation.

Posted: 06 Sep 2022 17:57
by admin
eil wrote: 06 Sep 2022 12:20 BTW, would be great if confirm() gets icons parameter like msg().
Okidoki. :)

Re: Paper Folder "On Delete Remove Items" scripting corelation.

Posted: 06 Sep 2022 21:59
by eil
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?

Re: Paper Folder "On Delete Remove Items" scripting corelation.

Posted: 07 Sep 2022 08:35
by admin
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.

Re: Paper Folder "On Delete Remove Items" scripting corelation.

Posted: 07 Sep 2022 21:38
by eil
admin wrote: 07 Sep 2022 08:35PS: However, there is a bug in the return of confirm. Fix comes.
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', '|') : '' ) ;

Re: Paper Folder "On Delete Remove Items" scripting corelation.

Posted: 08 Sep 2022 15:18
by eil
Need some help with reasons above.

Re: Paper Folder "On Delete Remove Items" scripting corelation.

Posted: 08 Sep 2022 15:55
by LittleBiG
eil wrote: 08 Sep 2022 15:18 Need some help with reasons above.
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;
Remove:

Code: Select all

$selected=<curitem>; selectitems $selected; delete 1,1,":list";

Re: Paper Folder "On Delete Remove Items" scripting corelation.

Posted: 08 Sep 2022 21:18
by eil
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.