XYSlideshow

Discuss and share scripts and script files...
Post Reply
serendipity
Posts: 3358
Joined: 07 May 2007 18:14
Location: NJ/NY

XYSlideshow

Post by serendipity »

Just for fun, a slideshow for your images.
Inspiration from this post:
http://www.xyplorer.com/xyfc/viewtopic. ... 016#p77016
Its very basic and crude, but works fine.

1) Copy below script and save as XYSlideShow.xys;
2) Select items to preview and start script (eg: from address bar: load "XYSlideShow.xys";). Note: Select at least 2 items.
3) Also works if you don't select anything, enter extensions you want to preview next to variable "$filter" in the script. I've added jpg, jpeg, bmp, png and tif.
4) Adjust delay (first line).
Be warned it uses the undocumented sendkeys (nothing wrong, its just undocumented).
Drawbacks: Since XY is just sending keys to preview window, make sure you keep preview window visible during the entire slide show.
You can abort slideshow midway by holding escape. If you abort you will get filtered view, use Ctrl+Shift+J to go back your original view.
Update use this code:
Was a small error.
http://www.xyplorer.com/xyfc/viewtopic. ... 054#p77054
Last edited by serendipity on 25 Sep 2012 18:06, edited 1 time in total.

klownboy
Posts: 4141
Joined: 28 Feb 2012 19:27

Re: XYSlideshow

Post by klownboy »

Hi serendipity, it works very nicely when I select files, but it seems to be exhibiting some odd behavior if nothing or a folder is selected either in the tree pane or file list pane. After running it with a folder selected, I received an error message that the 5 files in that folder selected didn't match the filter selection, but they were ".jpg" files that view just file in XY. And then came the odd behavior...I'd click on C: drive in the tree pane and it would go back to F: without me touching anything...back and forth. I had to exit out of XY to stop that behavior. I didn't touch the filter line in the script. I'd be strickly looking at JPGs in this case anyway. It would be nice or I should say, even nicer, if one could select a folder either in the tree pane or the list pane to view the contents of the folder. I think that's probably what you intended?
Thank you,
Ken
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440

serendipity
Posts: 3358
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: XYSlideshow

Post by serendipity »

klownboy wrote:Hi serendipity, it works very nicely when I select files, but it seems to be exhibiting some odd behavior if nothing or a folder is selected either in the tree pane or file list pane. After running it with a folder selected, I received an error message that the 5 files in that folder selected didn't match the filter selection, but they were ".jpg" files that view just file in XY. And then came the odd behavior...I'd click on C: drive in the tree pane and it would go back to F: without me touching anything...back and forth. I had to exit out of XY to stop that behavior. I didn't touch the filter line in the script. I'd be strickly looking at JPGs in this case anyway. It would be nice or I should say, even nicer, if one could select a folder either in the tree pane or the list pane to view the contents of the folder. I think that's probably what you intended?
Thank you,
Ken
Oops, small mistake. try this:

Code: Select all

//XYSlideShow
/*
1) Select items and start script. Note: Select at least 2 items.
2) Also works if you don't select anything, make sure sure to include extensions you want to see next to variable "$filter" in the script.
3) Adjust delay (first line).
Be warned it uses the undocumented sendkeys (nothing wrong, its just undocumented).

*/

  $seconds=2000; // Delay in ms (1000 = 1 second)
  focus;
  $item=get("CountSelected");
  $selected=get("SelectedItemsNames");
  IF($item < 2){
  $filter= "*.jpg; *.jpeg; *.bmp; *.png; *.tif";
  selfilter $filter;
  $item=get("CountSelected");
  #359;
  sel 1;
  }
  ELSE{
  #359; //Filter by Selections
  sel a;
  $item=get("CountSelected");
  sel 1;
  }  
  $count=0; 
  wait (300);
  #178; 
   WHILE($count < $item){ 
       wait ($seconds); 
       sendkeys ("{PGDN}"); 
       $count++; 
       }
  #178; 
  filter;
  wait (200);
  selectitems $selected;
  wait (200);
  status "End of Slideshow";
  

klownboy
Posts: 4141
Joined: 28 Feb 2012 19:27

Re: XYSlideshow

Post by klownboy »

Hi again serendipity,
That tweak seems to have fixed the issue with running the slideshow script from a folder as well as from selected files. However, I still had the same issue I explained above with the highlighted drive jumping from the current drive to down below, the network drive (or whatever the last drive is). If I click on C: it would jump back to Network. I think it's only doing this when you escape out of the slideshow routine before it's done or try to. So for some reason that is causing the highlighted drive in the tree to jump back to the bottom of the tree. The thing is, the behavior doesn't seem to be consistently repeated. Are you experiencing anything similar when trying to escape or break out of the slideshow maybe it's an issue on my end. I do use autohotkey as well. Actually, I just exited out of all my AutoHotkey file and it still did the same thing when I escaped out of the slideshow (or tried). Is there something that could be added to recognize a break in the slideshow by hitting escape maybe?
Thanks again,
Ken
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440

serendipity
Posts: 3358
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: XYSlideshow

Post by serendipity »

klownboy wrote:Hi again serendipity,
That tweak seems to have fixed the issue with running the slideshow script from a folder as well as from selected files. However, I still had the same issue I explained above with the highlighted drive jumping from the current drive to down below, the network drive (or whatever the last drive is). If I click on C: it would jump back to Network. I think it's only doing this when you escape out of the slideshow routine before it's done or try to. So for some reason that is causing the highlighted drive in the tree to jump back to the bottom of the tree. The thing is, the behavior doesn't seem to be consistently repeated. Are you experiencing anything similar when trying to escape or break out of the slideshow maybe it's an issue on my end. I do use autohotkey as well. Actually, I just exited out of all my AutoHotkey file and it still did the same thing when I escaped out of the slideshow (or tried). Is there something that could be added to recognize a break in the slideshow by hitting escape maybe?
Thanks again,
Ken
All the script does is open floating preview and send Page down key. What key do you have for going to the next slide in floating view? Maybe try changing
sendkeys ("{PGDN}");
to
sendkeys ("{SPACE}");

Let me know.
Thanks.

klownboy
Posts: 4141
Joined: 28 Feb 2012 19:27

Re: XYSlideshow

Post by klownboy »

Hey serendipity,
Have you ran SlideShow on the latest beta 11.60.0202? I received this error when it attempts to load the 2nd image in the slideshow. See attached. I received this message whether I used "PgDn" or "Space" in the script to move along to the next pic. As you said though I'm sure it is the sending page down that is causing the highlighted drive to jump down when I escape out of the slideshow before it ends and using space wouldn't do that. I suppose I shouldn't be trying to escape out of the slideshow anyway and just let it run it's course. There were a number of floating preview changes that may have spawned this error - possibly?
Thanks,
Ken
Attachments
Slideshow_capture.jpg
Slideshow_capture.jpg (37.39 KiB) Viewed 3296 times
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440

serendipity
Posts: 3358
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: XYSlideshow

Post by serendipity »

klownboy wrote:Hey serendipity,
Have you ran SlideShow on the latest beta 11.60.0202? I received this error when it attempts to load the 2nd image in the slideshow. See attached. I received this message whether I used "PgDn" or "Space" in the script to move along to the next pic. As you said though I'm sure it is the sending page down that is causing the highlighted drive to jump down when I escape out of the slideshow before it ends and using space wouldn't do that. I suppose I shouldn't be trying to escape out of the slideshow anyway and just let it run it's course. There were a number of floating preview changes that may have spawned this error - possibly?
Thanks,
Ken
I get the same error if i use space. So I guess don't use space.
What keys do you use in your floating preview?
Just make sure this key does not interfere with anything else.
Also when you escape out of slide show, press escape and hold it (hitting once will just escape the preview window, not the script itself). So key is to hold escape longer.

klownboy
Posts: 4141
Joined: 28 Feb 2012 19:27

Re: XYSlideshow

Post by klownboy »

Hey again serendipity, I thought I was getting that same error using "PgDn", but maybe I hadn't saved the change or something flukey because now it does work and on my desktops as well. Strange though, what I discovered is that escaping once as I was doing and the script keeps sending PgDn in whatever program was active like iExplorer. I say that because I figured XY script would only send keys to XY, but apparently it's sending to whatever is active because it certainly is in this case...Hmmm...maybe that knowledge could actually be useful/helpful knowing XY scripting can send input to another program (undocumented of course). In AutoHotkey you can direct the key or mouse input towards a specific program with the "ControlSend" command. By the way, I haven't changed the defaults to move along when viewing in Floating Preview, it's set at PgDn and Space.
Thanks,
Ken
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440

Post Reply