Anyone know how to make scripts for these 2 actions? I want to make 2 toolbar buttons out of them...
- switch to thumbnails view and sort by modified date [ascending]
- switch to list view and sort by name [ascending]
How to make these 2 simple scripts?
Re: How to make these 2 simple scripts?
For adding CTB ("Custom Toolbar Buttons")ghost zero wrote:Anyone know how to make scripts for these 2 actions?
I want to make 2 toolbar buttons out of them...
you may use this how to: http://www.xyplorer.com/xyfc/viewtopic. ... 908#p40908
For using internal function ("Command IDs")- switch to thumbnails view and sort by modified date [ascending]
this description may help:
First note that "switch to thumbnails view"
can be found in Menu "View > Current Tab > Views > thumbnails "
The corresponding script command ID
can be seen in the "Customize Keyboard Shortcuts"-Dialog (at the "Tools"-menu)
Select here the Category "View" (corresponding to the "View"-menu)
and then find the command at the same position as in the view menu too.
Click on one of the thumbnails commands, f.ex at "Thumbnails #1",
and you see "#306" at an button below in that dialog.
That is the script command for that internal function: #306
(note that an script command need an trailing semicolon, so use #306; here inside an script)
(Hint: use "[Options...] > Copy Cheat Sheet" for an print-out of all IDs)
They same for "sort by modified date", Modified = #326;
For to sort Ascending or Descending i think you have to use the script command "sortby()"
See help > Advanced Topics > Scripting Commands Reference:
//sortby [column], [order (|a|d|clk)]
sortby "Modified", a;
So your script would be as simple as: #306; sortby "Modified", a;
- switch to list view and sort by name [ascending]
If you have more questions just ask, someone may help
Last edited by Stefan on 27 Jan 2011 12:41, edited 2 times in total.
-
ghost zero
- Posts: 842
- Joined: 26 Apr 2010 17:48
Re: How to make these 2 simple scripts?
thanks, but how do i make it so that the list view won't toggle between list and details view when pressed multiple times? same for the thumbnails view?
currently, since CTB can't stay pressed, a button can risk accidently being pressed twice and causing undesired toggle behavior.
currently, since CTB can't stay pressed, a button can risk accidently being pressed twice and causing undesired toggle behavior.
Re: How to make these 2 simple scripts?
Ohh, #306; is an toggle ?! Right! Didn't know that till now.
I think an solution could be the brand new get() parameter "View"... IF "View" != 4 Then #306;..., but i have no time right now....later, yes?
I think an solution could be the brand new get() parameter "View"... IF "View" != 4 Then #306;..., but i have no time right now....later, yes?
Re: How to make these 2 simple scripts?
I think this should do it... maybe...
Code: Select all
"Thumbnails 1 by Modified"
if (Get('View') != 4) { #306; }
if (Compare(Get('Sort'), 'Modified,a')) { SortBy('Modified', 'a'); }
"List by Name"
if (Get('View') != 2) { #304; }
if (Compare(Get('Sort'), 'Name,a')) { SortBy('Name', 'a'); }-
ghost zero
- Posts: 842
- Joined: 26 Apr 2010 17:48
Re: How to make these 2 simple scripts?
seems to work great, thanks!
XYplorer Beta Club