Know upfront scripting is new to me.
This moveto E:\Emitter\ runs perfectly from Scripting|Try Script but when used as a Catalog item (with the prepositional ::) it yields a "Nothing selected or what is selected cannot be moved".
The vexation comes not from that something is wrong but that it operates in the former case but not the latter.
Vexed by simplest "moveto" script
-
aurumdigitus
- Posts: 1075
- Joined: 30 May 2008 21:02
- Location: Lake Erie
-
jacky
- XYwiki Master
- Posts: 3106
- Joined: 23 Aug 2005 22:25
- Location: France
- Contact:
Re: Vexed by simplest "moveto" script
That would be because when you click on the Catalog item, focus is on Catalog and therefore command moveto relates to the Catalog item you just clicked. To prevent that, simply add focus; before, to send the focus back to List:
Code: Select all
::focus; moveto "E:\Emitter\";Proud XYplorer Fanatic
-
aurumdigitus
- Posts: 1075
- Joined: 30 May 2008 21:02
- Location: Lake Erie
Re: Vexed by simplest "moveto" script
Little Grasshopper humbly accepts you instruction oh great xywiki Master.jacky wrote:That would be because when you click on the Catalog item, focus is on Catalog and therefore command moveto relates to the Catalog item you just clicked. To prevent that, simply add focus; before, to send the focus back to List:Code: Select all
::focus; moveto "E:\Emitter\";
Still, it seems a little disingenuous that the code works in Try Script without any warning of possible pitfalls using it elsewhere. But that is the price tyros have to pay.
And also thank you for the alacrity of response!
-
TheQwerty
- Posts: 4373
- Joined: 03 Aug 2007 22:30
Re: Vexed by simplest "moveto" script
Alternately, you could use the GetInfo function to include the selected list item paths and ignore the focused control entirely using:
Code: Select all
::MoveTo("E:\emitter",GetInfo("SelectedItemsPathNames","|"));-
aurumdigitus
- Posts: 1075
- Joined: 30 May 2008 21:02
- Location: Lake Erie
Re: Vexed by simplest "moveto" script
Thanks for the code segment which clearly utilizes advanced features. It will be filed away for reference when scripting has been better comprehended.TheQwerty wrote:Alternately, you could use the GetInfo function to include the selected list item paths and ignore the focused control entirely using:Code: Select all
::MoveTo("E:\emitter",GetInfo("SelectedItemsPathNames","|"));
XYplorer Beta Club