Page 1 of 1
Vexed by simplest "moveto" script
Posted: 05 Feb 2009 15:51
by aurumdigitus
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.
Re: Vexed by simplest "moveto" script
Posted: 05 Feb 2009 16:03
by jacky
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:
Re: Vexed by simplest "moveto" script
Posted: 05 Feb 2009 16:21
by aurumdigitus
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:
Little Grasshopper humbly accepts you instruction oh great xywiki Master.
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!
Re: Vexed by simplest "moveto" script
Posted: 05 Feb 2009 16:23
by TheQwerty
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","|"));
Re: Vexed by simplest "moveto" script
Posted: 05 Feb 2009 17:01
by aurumdigitus
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","|"));
Thanks for the code segment which clearly utilizes advanced features. It will be filed away for reference when scripting has been better comprehended.
