Sequential picture viewing in the scrap window after Search?

Discussion & Support for xplorer² professional

Moderators: fgagnon, nikos, Site Mods

Kilmatead
Platinum Member
Platinum Member
Posts: 4578
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

FrizzleFry wrote:Sometimes it is quicker to use the command line... no need for rodent use :)
I think I developed a bad habit years ago (that I can't break) of just opening console windows everywhere - it never seems to dawn on me to use that white line at the top of the screen.  Having grown up with dreary terminals chasing me everywhere, I conversely find I love my glowing blue rodent!  Trusty little guy's worth a hundred DECwriters of old. :wink:
User avatar
CrossX
Bronze Member
Bronze Member
Posts: 129
Joined: 2009 Dec 05, 21:13

Post by CrossX »

I think this topic should be moved to "Especially Useful xplorer² Topics"
Don't you think so?

At least Kilmatead's work doesn't go lost  :wink:
Kilmatead
Platinum Member
Platinum Member
Posts: 4578
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

Considering that this topic has been superseded (at least as far as IrfanView is concerned) by the new "$>" token (x2 2.0), it's no longer relevant.  You may just define the user command as:

Code: Select all

> i_view32.exe /filelist=$>
That's it - no script needed at all. :D

...and before anyone complains that this token is "undocumented" - it is mentioned in the changelog, but Nikos conveniently "forgot" to add it to the in-programme $-Token help window before release - which I even reminded him to do.  It has been mentioned in a few posts recently, and as a general rule I suggest it as the default method for anyone who may write file-handling scripts in the future, as it allows a virtually infinite number of selections to be passed to any given utility, instead of being limited by the command-line length.  In Nikos' world, he reckoned no one would ever need to do this, so he added it for no reason other than just to shut me up.  We bottom-feeders take what we can get. :wink:

And, as the Gods continue to deny us an area of the forum for bespoke scripting, I might be tempted to give it an Anti-Blog at some point just to explain how it may be implemented (for scripting).  The token will get a mention in the new Wiki manual, whenever that breathes its first malignant sigh of vengeance to the world, though even narayan didn't know about it beforehand (tsk, tsk, tsk) due to his lazy attitude towards reading changelogs.  :twisted:
User avatar
CrossX
Bronze Member
Bronze Member
Posts: 129
Joined: 2009 Dec 05, 21:13

Post by CrossX »

Thanks!
Glad to know!
Gary M. Mugford
Bronze Member
Bronze Member
Posts: 150
Joined: 2009 Oct 14, 00:54
Location: Brampton ON Canada

Post by Gary M. Mugford »

Kilmatead wrote:Considering that this topic has been superseded (at least as far as IrfanView is concerned) by the new "$>" token (x2 2.0), it's no longer relevant.  You may just define the user command as:

Code: Select all

> i_view32.exe /filelist=$>
That's it - no script needed at all. :D

...and before anyone complains that this token is "undocumented" - it is mentioned in the changelog, but Nikos conveniently "forgot" to add it to the in-programme $-Token help window before release - which I even reminded him to do.
Thanks for the bit of custom code. As with a lot of things you've yet to chance upon, ignorance isn't bliss. In fact, I needed that code today. I had dispensed with my old irfan view calling button in the interests of conserving space in the toolbar width area. I just double-clicked and then used IrfanView's internal travel buttons. But of course, that's all encompassing. I wanted to JUST review three out of a lot of about 45 logo submissions. So I highlighted them, copied them to the _trial folder and then did what I normally do. Review and delete. Your code saves more than a couple of steps and gives lazy folk like me more reason to like our tools. (and yes, I know I've set you up for a naughty metaphor if you reply)

But I just had to say thanks to you (and to Nikos).
Kilmatead
Platinum Member
Platinum Member
Posts: 4578
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

Gary M. Mugford wrote:...and yes, I know I've set you up for a naughty metaphor if you reply
As it's a Sunday, I'll pretend to have the sophistication enough to rise above the naughty metaphor, for what are we to aspire to but the traversal of dust in the residuum of time?  If a human hopes for more, he is reaching beyond his happy medium of pedantry into the mystical - forsaking the realm of the predictable (this is my wife, my children, my albatross) for another world where you visit the local zoo on an afternoon, and suffer the queer impression that the animals inside are indeed the animated - but the humans on your side of the barred cages are of the inanimate stylites, bound to pretend their own sophistication far far above the ant colony at our feet.

We peer down upon them and ask, "But what do you think you're doing with all that energy, little be-ing?  Where are you going with such angry purpose?"  But the ants pay us no mind, and continue to dither and thither with the kind of fascination only the worldly indifferent can muster into strength.

The most interesting thing though, is this phrase:
Gary M. Mugford wrote:...ignorance isn't bliss...
Which terribly begs the question of just what is Ignorance and just what is Bliss?  For instance, one could imagine those who strive to enjoy their lives (as if they were actually "their" lives in the first place) are doomed to be reincarnated as the pitiable moth drawn to the flower that only grows at the volcanoes mouth - forever ignorant of the impending doom their seclusion portends - yet happy with it all the same.  So, by the logic of reincarnation (if it has a logic) that very happiness dooms them yet further into the iteration of light.

For example (and I am as usual not as far off-topic as I may seem :wink:), consider the misunderstanding humans fall into when they conceive of things as a simile rather than a metaphor by using the common-phrase, "...drawn like a moth to the flame".  We like to think of ourselves that we are brighter than the average insect, so as we sit around the fire at night with the obligatory beer, friends, and cigarettes, we philosophise about the stupidity of the moth as it flutters inevitably around the thing of it's doom.  "Why does it do that?" we ask ourselves, feeling the creeping unease that nature may have more in store for us than we can handle.  "Perhaps it feels no pain," we say, explaining the irrational attraction to ourselves as a kind of harmless passivity.  Or, "Perhaps it knows something we don't," delving back into the mystical which is our safe-haven.

Curiously, the answer science provides is a combination of what is called transverse orientation, common olfaction, or more interestingly the illusion of what is called the Mach band, wherein the gradient delimitation between luminance sources disturbs the moth's spatial sense inversely - moths are drawn to the dark (ironically, not the light) and so subsequently their eyes cannot attune properly to super-bright light (the centre), interpreting it instead as an inverse darkness of the halo - thus they actually "see" the greatest brightness as a deeper darkness and thus try to fly into it.

Pretty girls have the same effect upon our own retinae, causing men no end of trouble with our own spatial orientations. :D

But we started out by asking what is Ignorance.  Simplistically, it's what we don't know.  But I will amend that that to suggest it's more a matter of what we don't want to know - as veiled by the responsibility of actually having to learn things ourselves (which is painfully hard work), we seek the ease and sedation of Bliss (imagined enjoyment?) as a substitute, where the less effort needed to gain what we believe we want (or imagine we need) is seen as the greater good of efficiency.

For example, let's take this new "$>" token in the milieu of scripting.  From the point of view of the scripter himself, the first reaction is to say "Ok, I'll read the data line by line from the file and process it accordingly, much as how I would process any given command-line arguments as sourced by the "$A" token (a series of selected full filepaths, for those who don't read the help manual :wink:).  In fact, if one imagines 5000 passed arguments (not at unknown occurrence for some functions, such as moving files or mass-renaming them), we would say "this is so much more efficient - it takes up less memory, I only need to process the one "in hand" at the time, and it allows for infinite probability with the least amount of used resources.  So, in AutoIt (for simplicity) we get:

Code: Select all

$iFile = FileOpen($FileList, 0)

While 1
	$FilePath = FileReadLine($iFile)
	If @error Then ExitLoop

	Process($FilePath) ; Ad infinitum until done
WEnd

FileClose($iFile)
...where Process() is obviously the function that does whatever dirty deed you need done.

"Ok," you say, "that's simple enough, and it works, why are you explaining to me what I already know?"

Well, the "$>" token actually dumps all your selections into a CRLF-separated text file in the user's Temp folder called (in my case):

C:\Users\Kilmatead\AppData\Local\Temp\x2tmpList.txt

"Great," you say, "now I can read it, job done - why have you got your knickers in a twist?"

Well... not quite.  As I mentioned initially (a few posts above) Nikos added this primarily to shut me up.  Ordinarily the windows command line (through which User Commands pass their arguments) is limited to a few thousand characters, which means that if you pass full pathnames (rather long strings) you can run out of space and the script fails - what works for 5, 10, 100, or even 500 files will unexpectedly fail at 750 or 2000, or whenever, depending on the lengths of those individual filepaths.  One workaround (before the "$>" token) was to pass two arguments: "$P" and "$S" which would pass the path once as a single string, and all the filenames as just that, names, no paths.  Your script would then concatenate the path with each filename before processing, and you could de facto condense the amount of text that would fit in your available command line space (this varies by the type of scripting your using, VBS and PowerShell are very limited, while AutoIt is more generous (and I imagine AHK is similar) - but it's still a finite space string.  Most applications would be subject to Windows default length (that few thousand characters) as well, so it's a poor system to use.

Thus was born the ListFile.

"Ah, I see!" I hear you say, "Now shut up and let me script, you babbling loquacious lout!"

Hold on a minute, my eager friends.  Imagine, if you will, a Process() which (as the example above) reads each line individually... what happens if either A) that script takes a long time to complete, or B) the user pauses it, and in the meantime he goes off to do something else?  If that "something else" Involves calling another script with a "$>" token, the original file (which the first script is still reading) is actually overwritten and then very bad things happen, as you can imagine.

This was my fault, as when I suggested the original idea to Nikos I neglected to say the filename generated in the Temp folder should be guaranteed to not exist first (so that overwriting bug doesn't happen) - but I had pestered him enough that day, and wasn't going to push my luck.  So we have to deal with this ourselves.

We have two choices - either rename the x2tmpList.txt file to something we know is guaranteed not to exist or read the whole file into an array first.  In AutoIt this can be done with the UDF _TempFile() function, or using _FileReadToArray() which just creates a 1-based array containing all the filenames (theoretically this is limited by the memory of a computer to hold the variable size of the array, but in reality this is not much of a limitation).  So, instead, the script becomes:

Code: Select all

_FileReadToArray($ListFile, $FilePathArray)

For $i = 1 To $FilePathArray[0]
	Process($FilePathArray[$i])
Next
Now you can criss-cross as many "$>" tokens as you like without fouling the air of independent programme instances.  (Obviously any scripts should include detailed error checking to make sure the file was read properly, etc - I left that out of the above example for brevity.  Brevity?  Who me?  Never bloody heard of it.)

"So," I hear you scream, "What the heck does this have to do with Moths, Flames, Ignorance, Bliss, or that Mad Austrian, Ernst Mach?"

You'll note that therein lies the nature of the Anti-Blog - incoherent babble smorgasborded (is that a word?) with a few small insights, to create an unreadable whole on a Sunday morning.  :shrug:  And if - as fgagnon once counted himself - someone actually reads all my nonsense, he may consider this as my own impractically mystical form of protest against not having a scripting forum.  Try and categorise this in your neat little world of engineered organisation!  That said, even if there were such a forum, I would still write the same convoluted rubbish (it's my nature), but at least it would be placed far away from the eyes of the un-curious masses who care not about such esoteric weirdness.

:D

Addendum:
Gary M. Mugford wrote:...if you reply
Indeed. :wink:
User avatar
fgagnon
Site Admin
Site Admin
Posts: 3737
Joined: 2003 Sep 08, 19:56
Location: Springfield

Post by fgagnon »

@ categorise this in your neat little world ... -
happily, or not, I have little neatness in my worlds.  :shock:

@ ... even if there were such a forum ... -
I expect that you would not restrict/quarantine yourself to it, so there'd be no point in doing it.  :shrug:
Kilmatead
Platinum Member
Platinum Member
Posts: 4578
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

fgagnon wrote:@ ... even if there were such a forum ... -
I expect that you would not restrict/quarantine yourself to it, so there'd be no point in doing it.  :shrug:
Quarantine myself - well, of course not, though it would at least give you a means of telling me actually where to "shove it" as the need doth arise. :wink:  I still think you're missing the big picture - it's not your mailbox that's filled with script-requests, now is it?  And perhaps the mildly disinterested forum lurkers would be interested in getting a glimpse at the development process, so they might learn by osmosis?

What are you doing awake at 7:37AM on a Sunday morning?  Shouldn't you be getting your beauty sleep?
User avatar
fgagnon
Site Admin
Site Admin
Posts: 3737
Joined: 2003 Sep 08, 19:56
Location: Springfield

Post by fgagnon »

@ awake -
sipping my coffee, wondering why the newspaper hasn't been delivered yet, thinking that if you were suggest a few meritorious scripting threads (of the 300+ out there) that I might actually create a separate forum for them, heading outside to pick a few cucumbers, beans, squash, ...
Kilmatead
Platinum Member
Platinum Member
Posts: 4578
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

Now that's a sneakily suggestive approach - though I hadn't conceived it in the same terms as the "Especially Useful" thread-o-clutter - I was thinking more of starting with a clean slate, to simplify things.  If others wanted certain threads added, they could petition your cucumbers accordingly as the need arose.  This way, there's not so much of an "Oh jeez, I gotta troll through all this old crap first?" response.  (I actually cringed the other day when I saw that INeedHelp had inadvertently included a really old batch script of mine in his (otherwise excellent) collection - I have gotten better at designing these things properly recently, to be more robust than garden variety batch hacks. :shrug:)

Many of these 300 threads of yours are either now deprecated (like this one) or tucked away in other threads which bear no relation to the original topic (you did mention once you can't dissect individual threads into amalgamated component posts).  If any given idea or request had its own thread, it would at least suppress errant defragmentation.

I'm not denying the Tabula Rasa approach wouldn't be that exciting at first (we don't, admittedly, have the same throughput of users as other forums), but until the horsey-threads qualify for the most recent dressage tournament, I struggle to see the reticence for the relevancy ("forest for the trees" just didn't have the same ring of consonance & sibilance to it :wink:).  Should we take a poll?
User avatar
fgagnon
Site Admin
Site Admin
Posts: 3737
Joined: 2003 Sep 08, 19:56
Location: Springfield

Post by fgagnon »

@ can't dissect -
Except crude separating can be done --- in that the bbs tools allow moving individual posts from a single thread to a new thread, but not adding anything to an existing thread.  
So there's no collecting of disparate posts into a single basket, unless by reference: quoting from and placing links to them in the basket as IneedHelp has done with his  user commands repository thread.
Kilmatead
Platinum Member
Platinum Member
Posts: 4578
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

Repository - that's the word I couldn't think of.  Actually I had great fun re-reading the fragmentation you created from one of those threads yesterday.  The colloquy with Mr.Pleasant is what justifies off-topic rambling in all things, regardless of the mess it makes.  I'm not suggesting a study of outrecuidance (now there's a word!) through narcissism, if that's the fear - lord knows I don't need a bigger playground for my shameful carry-on.  It's not like I'm asking for a Beaver-Training forum or anything (who mentioned naughty metaphors anyway?) - but maybe having an "empty" box will inspire others to feel bolder towards jumping in.  Of course, it could fail to do so as well... hard to know without even a probationary chance.

(For what it's worth, I hadn't actually intended any of this today... must have been something in my own tea-sipping this morning...)
Kilmatead
Platinum Member
Platinum Member
Posts: 4578
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

Hmm...
Outrecuidance : (n.f.) 1. Confiance excessive en soi-même ; présomption, prétention. 2. Désinvolture impertinente ; arrogance, impudence.
God, you know what I'm thinking about doing now...  :twisted:  That is a great f-ing word, if ever t'was.  If nothing else, that alone makes my day. :D
User avatar
IneedHelp
Gold Member
Gold Member
Posts: 612
Joined: 2010 Feb 04, 02:15
Location: MeanWhile City

Post by IneedHelp »

Kilmatead wrote:INeedHelp had inadvertently included a really old batch script of mine [...]I have gotten better at designing these things properly recently, to be more robust than garden variety batch hacks. :shrug:

I was perfectly aware of how old it is, but by no means have I tried to surface deprecated scripts, I was merely trying to enrich the list's variety. Your skills indubitably improved since then, but as long as the script is still valid for whoever may need it, and in lack of a post presenting a better solution, I believe it deserves its place :D
Kilmatead
Platinum Member
Platinum Member
Posts: 4578
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

And in the far far distant future when some (now) imaginary wife wants to put your baby-pictures up on the internet, I'll remind you of that egalitarian attitude.  :D   Final proof of just how wrong Gary M. Mugford's dictum that "ignorance isn't bliss" can be.

Cringe, cringe, cringe.  :yuck:
Post Reply