Page 3 of 4

Re: Freezing / lagging during thumbnail creation

Posted: 29 Mar 2020 23:44
by highend

Code: Select all

    $command = <<<>>>
"<xy>" /path="D:\your picture path\" /new /script="::#307;wait 1000;#1001;#501;wait 3000;#1001;if(get('instance')=='2') {exit 'n';}"
>>>;
    run $command, "%TEMP%", 2, 1;

Re: Freezing / lagging during thumbnail creation

Posted: 30 Mar 2020 00:41
by m48tx
Thank you, highend. I guessed this is to be coded as a script, so I copied the code into my file run.xys in the roaming Scripts folder, changed the path, then typed load "run.xys"; into the address bar, hit the enter key and the script ran as expected [with XYplorer in C:\Program Files (x86)]. I did change /path="D:\your picture path\" to /path="<curpath>" and I click on the appropriate path first.

klownboy, is it possible to fold this logic into your script (version 1.18)? If you could provide some help I will gladly make the change to my copy of the script.

Re: Freezing / lagging during thumbnail creation

Posted: 30 Mar 2020 01:17
by klownboy
Thanks highend. Should have thought of using a heredoc. It does seem to resolve many of the issues in running these type of scripts.

For setups with XY in Program files folder or other folders with spaces, is it necessary to have "%Temp%" in the directory field. Just curious. For me your code line works both with and without the %Temp% in the directory field, but would it not work for m48tx?
@m48tx could you try it again with that field blank to see if it still works properly. ...run $command, , 2, 1; Thanks.

Thanks again highend. In my next update for the Thumbnail Maintenance script, I'll adapt this to suit. I'm in the process of eliminating any dubious syntax errors encountered with Syntax checking on.

Re: Freezing / lagging during thumbnail creation

Posted: 30 Mar 2020 02:14
by m48tx
klownboy, your requested modification works properly.

Re: Freezing / lagging during thumbnail creation

Posted: 30 Mar 2020 03:26
by RalphM
m48tx, for the sake of all forum users here, could you please refrain from quoting the whole previous post in your replies?
It doesn't add anything to the readability of the thread.
Thanks.

Re: Freezing / lagging during thumbnail creation

Posted: 30 Mar 2020 05:09
by m48tx
RalphM, for your sake, I edited my entries. :|

Re: Freezing / lagging during thumbnail creation

Posted: 30 Mar 2020 08:50
by highend
is it necessary to have "%Temp%" in the directory field
No, it's just a "better be on the safe side".
If the folder you're currently in is deleted (3rd party utility | a subfolder of temp | etc. <-> / not available (network or anything else), the script command will fail.

Re: Freezing / lagging during thumbnail creation

Posted: 30 Mar 2020 08:58
by RalphM
I hope you didn't just do it for my sake but got the point I was trying to make?! :appl:

Re: Freezing / lagging during thumbnail creation

Posted: 30 Mar 2020 13:04
by klownboy
highend wrote: 30 Mar 2020 08:50 No, it's just a "better be on the safe side".
OK I see what you mean, but in my specific case, in the "command" field the full path of XY is provided via <xy>. Help for SC run directory field states, The working directory, allows you to skip the path in command; defaults to current path. So it defaults to current path if the path is not in command field. It doesn't appear that the current folder has any bearing for my case at least it shouldn't as long as the full path of the executable command is provided. No a big deal obviously just making sure I understand. Thanks highend and thank you m48tx for testing...again.

Re: Freezing / lagging during thumbnail creation

Posted: 30 Mar 2020 21:32
by m48tx
highend & klownboy,

I created a toolbar button to run this script to create thumbnails in new instance of XY (option to create all thumbnails at once must be ticked):

Code: Select all

$command = <<<>>>
"<xy>" /path="<curpath>" /new /script="::#306;wait 200;exit 'n';"
>>>;
    run $command, , 2, 1;
I was hoping I could start multiple instances of the script simultaneously from instance 1 of XY, but that does not work. Is a script limited to one instance at a time?

** quote free post **

Re: Freezing / lagging during thumbnail creation

Posted: 30 Mar 2020 21:38
by highend
And you did read the help regarding the run command? Doesn't seem so...

Re: Freezing / lagging during thumbnail creation

Posted: 30 Mar 2020 21:49
by m48tx
I read the help on run before I posted. Ok, I changed 2 to 0.

Re: Freezing / lagging during thumbnail creation

Posted: 31 Mar 2020 00:34
by klownboy
Hey m48tx, through out the script and my first post in this thread it is " ...2, 0". I changed the "0" to "1" only so you could better see what was going on when troubleshooting.

Hi highend, throughout the Thumbnail script I was using cmd /c as the lead-in for running the script in the background. It really seems it wasn't necessary for this situation so I'm going to remove it. I started using it for a different situation where where I found that if I didn't I would see the the hour glass momentarily on the screen. It was discussed in the Expandable Drive Button thread viewtopic.php?f=7&t=10272&start=45#p94029, but those scripts used the "/flg=2" to feed scripts into the existing instance of XYplorer. Thanks again.

Re: Freezing / lagging during thumbnail creation

Posted: 31 Mar 2020 18:28
by matija
Great to see an enthusiastic response to my topics, but it looks like XY can't be the TC upgrade I was hoping for..

Re: Freezing / lagging during thumbnail creation

Posted: 04 Apr 2020 17:23
by m48tx
klownboy, thank you for your help in this thread. Your willingness to help without harshness is most appreciated. I used your feedback and searched the forums for examples to create a script that starts at the selected image path in the tree, descends through all sub folders and creates #1 thumbnails. There are two configuration requirements and no safeguards but it does what I need. The scripting function of XY is a powerful tool. Again, thank you.

Code: Select all

$savepath = "<curpath>"; // save the starting path
  #311;                  // generate path list via branch view
                         // (configuration must be set to display folders only in branch view)
  #250;                  // select all paths in the list
  foreach($item, <get selecteditemspathnames>, <crlf>) {
    goto "$item"; #306;
}                        // for each item in the path list, go to the path then generate thumbnails #1
                         // (configuration must be set to create all thumbnails at once)
  goto "$savepath";      // once finished with path list, return to the starting path
  #1010;                 // collapse the starting path tree