Sequential picture viewing in the scrap window after Search?

Discussion & Support for xplorer² professional

Moderators: fgagnon, nikos, Site Mods

User avatar
CrossX
Bronze Member
Bronze Member
Posts: 139
Joined: 2009 Dec 05, 21:13

Sequential picture viewing in the scrap window after Search?

Post by CrossX »

I'd like to search through some directories containing pictures and to be able to see one after another (using for example IrfanView) the pics that, after the search, appear as result in the scrap window.

The problem is that in the scrap window, even if the pictures are grouped together, in reality they still point to their original locations so that a sequential view, only of those ones, cannot be done.

Any solution to this?

Thanks  :wink:
wperkins99
Bronze Member
Bronze Member
Posts: 106
Joined: 2004 Jul 11, 14:55

Post by wperkins99 »

Instead of using an external program to view the files, why not activate the Preview Pane (Ctrl-Q) in your Scrap Container and use it?
Kilmatead
Platinum Member
Platinum Member
Posts: 4842
Joined: 2008 Sep 30, 06:52
Location: Baile Átha Cliath

Post by Kilmatead »

wperkins99 wrote:...why not activate the Preview Pane (Ctrl-Q) in your Scrap Container and use it?
First, let it be said that I strongly recommend you use wperkins99 suggestion.  It's simple, and it works.

If, on the other hand, you really really really want to use your own Picture Viewer (like ladies underwear, purely "for comfort" :wink:), you can use this script instead:

Copy the following and save it somewhere as "PicView.VBS"

Code: Select all

Viewer = "C:\Program Files\IrfanView\i_view32.exe"

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("WScript.Shell")
Set objEnv = objShell.Environment("Process")

Louis = objEnv("TMP") & "\Daguerreotype"

if objFSO.FolderExists(Louis) then objFSO.DeleteFolder Louis, True

objFSO.CreateFolder(Louis)

Start = ""
for param = 0 to Wscript.Arguments.Count - 1
	strName = objFSO.GetFileName(Wscript.Arguments(param))

	Select Case LCase(Right(strName,4))
		case ".png", ".jpg", ".bmp"
			strName = "" & Right("0" & CStr(param), 2)  & "_" & strName
			
			if (Start = "") then Start = strName

			objFSO.CopyFile Wscript.Arguments(param), Louis & "" & strName
	end select
next

objShell.Run """" & Viewer & """" & Louis & "" & Start & """", 1, True

objFSO.DeleteFolder Louis, True
Then, create a User Command as such:

Code: Select all

> wscript "C:\Scripts\PicView.vbs" $A
...and place it on the toolbar of the scrap window.

Be sure to edit the first line of the script to point at whatever image viewer you happen to use (in this case, Irfan).

This method is a little weird, as it actually copies all the selected photos into a temporary folder (renaming them sequentially to preserve Scrap pane order), then calls the viewer with the first file - irfan takes care of the rest.  When you exit irfan, the temporary folder is removed and all is well again.

Only PNG, JPG, and BMP files are copied into the temp folder, to weed out anything else you may have "found" accidentally.

Incidentally, I tried this first using only shortcuts to the photos, but the same problem occurred: Irfan reads the original folder as source, so it didn't work.  This way, for what it's worth, does. :shrug:

Did I mention wperkins99 suggestion is better?  Yes, yes I did.  But this will actually provide the solution you asked for, if you're peculiarly particular about these persnicketly personable things. :wink:

(Oh God, the pain of boredom Fred - save me from myself.)
User avatar
FrizzleFry
Platinum Member
Platinum Member
Posts: 1255
Joined: 2005 Oct 16, 19:09

Post by FrizzleFry »

Instead of actually copying the pictures to another folder why not just create a picture list and feed it to Irfan?

<path to irfan>\i_view32.exe /filelist=filelist

a filelist is just a text list of fullpaths for each picture... one per line
Kilmatead
Platinum Member
Platinum Member
Posts: 4842
Joined: 2008 Sep 30, 06:52
Location: Baile Átha Cliath

Post by Kilmatead »

Fair enough - I don't use Irfan so I didn't know about picture lists. :shrug:  It doesn't just open all of them at once (as these things usually do if you present them with multiple arguments)?  Not a big deal to change it if the OP is still interested...
User avatar
CrossX
Bronze Member
Bronze Member
Posts: 139
Joined: 2009 Dec 05, 21:13

Post by CrossX »

Thanks for your replies guys  :wink:

@wperkins99
I want to see the images "full screen" and the preview pane is small.
I know, I can shrink the right pane so that the left pane widens.
The "Native" tag leads to a wider image but... see above :wink:
In short... I'd like to use Irfan View

@Kilmatead
Nice script... but even if it creates the Daguerrotype folder in %temp% and opens IrfanView... no jpg is copied inside
Since I don't know anything about scripts, could you please check it?

@FrizzleFry + @Kilmatead
How can I create automatically that "filelist"?
Could Kilmatead create the proper script?
Kilmatead
Platinum Member
Platinum Member
Posts: 4842
Joined: 2008 Sep 30, 06:52
Location: Baile Átha Cliath

Post by Kilmatead »

CrossX wrote:no jpg is copied inside
The only reason I can think no JPG's would be included is that their extensions may be .JPEG instead?  Other than that, I have no idea.  Just in case I took out that "safety filter" for filetypes in the script below, so there's no reason it shouldn't work.

Did you remember to put the $A in the user command?
CrossX wrote:Could Kilmatead create the proper script?
Done.  This just creates Daguerreotype.txt in your temp folder, and feeds it to Irfan (thanks Frizzle).  Simple.  As I mentioned, no checks are done for filetypes, so be careful what you select - Irfan doesn't digest other stuff well. :wink:

Code: Select all

Viewer = "C:\Program Files\IrfanView\i_view32.exe"

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set Shell = CreateObject("WScript.Shell")
Set objEnv = Shell.Environment("Process")

Louis = objEnv("TMP") & "\Daguerreotype.txt"

Set outFile = objFSO.CreateTextFile(Louis, True)
	for param = 0 to Wscript.Arguments.Count - 1
		outFile.WriteLine(Wscript.Arguments(param))
	next
outFile.Close

Shell.Run """" & Viewer & """" & " /filelist=" & """" & Louis & """" , 1, True

objFSO.DeleteFile Louis, True
Last edited by Kilmatead on 2011 Jan 02, 21:04, edited 1 time in total.
User avatar
CrossX
Bronze Member
Bronze Member
Posts: 139
Joined: 2009 Dec 05, 21:13

Post by CrossX »

No file loaded  :cry:  (says IrfanView).
The daguerrotype.txt is empty

Just to be sure... apart from the IrfanView correct folder in my C: drive, do I have to customize also other parts of your script?  :wink:
Kilmatead
Platinum Member
Platinum Member
Posts: 4842
Joined: 2008 Sep 30, 06:52
Location: Baile Átha Cliath

Post by Kilmatead »

Are you actually selecting the files?  You have to select them first (like Ctrl-A or something) then click the command.

What is the text in your user command, exactly?

(Nothing else in the script should need to be changed - especially as the file is created and Irfan runs. :?)
User avatar
CrossX
Bronze Member
Bronze Member
Posts: 139
Joined: 2009 Dec 05, 21:13

Post by CrossX »

Maybe it is because I haven't created a Toolbar button (because I don't know how to do it) but I ran that command
> wscript "C:\Scripts\PicView.vbs" $A
from the command line of the scrap window?

Now it is time to go to bed... I will try tomorrow, reading in the Manual how to create toolbar buttons :wink:
Kilmatead
Platinum Member
Platinum Member
Posts: 4842
Joined: 2008 Sep 30, 06:52
Location: Baile Átha Cliath

Post by Kilmatead »

Yeah, that would do it - x2 doesn't pass the $-tokens in interpreted form via the built-in command line, so the script never received the list of selected files as it should have.  You could have just run it from the Customize -> User Commands drop-down instead.

Once the user-command is defined (Customize -> User Commands -> Add New), you just Right-click on a toolbar (any toolbar, including scrap windows) and select Customize... from the context menu that appears.

Then find the new command by name from the long list of Bookmarks, Commands, etc that opens up on the left (for convenience, repeatedly type the first-letter of the name you want until it shows up).  Just select it, click "Add" and Bob's your uncle.  :wink:
User avatar
FrizzleFry
Platinum Member
Platinum Member
Posts: 1255
Joined: 2005 Oct 16, 19:09

Post by FrizzleFry »

Kilmatead's script works fine for me running it from command line in scrap pane... I also ran it from a user command toolbar button successfully.

You have to select the files you want displayed (put in the file list)...

For this:

> wscript "C:\Scripts\PicView.vbs" $A

to work you need to save the PicView.vbs script in the C:\scripts folder.
Kilmatead
Platinum Member
Platinum Member
Posts: 4842
Joined: 2008 Sep 30, 06:52
Location: Baile Átha Cliath

Post by Kilmatead »

Hmm... rather odd - I just tried it again myself from the command line and it works now - but it definitely didn't work last night, whatever I was doing. :shrug:  That's what I get for never using the command bar - so much easier to just use buttons for repetitive tasks.  Apparently tokens are translated via the bar - learn something new every day. :D
User avatar
CrossX
Bronze Member
Bronze Member
Posts: 139
Joined: 2009 Dec 05, 21:13

Post by CrossX »

Kilmatead wrote:Yeah, that would do it - x2 doesn't pass the $-tokens in interpreted form via the built-in command line, so the script never received the list of selected files as it should have.  You could have just run it from the Customize -> User Commands drop-down instead.

Once the user-command is defined (Customize -> User Commands -> Add New), you just Right-click on a toolbar (any toolbar, including scrap windows) and select Customize... from the context menu that appears.

Then find the new command by name from the long list of Bookmarks, Commands, etc that opens up on the left (for convenience, repeatedly type the first-letter of the name you want until it shows up).  Just select it, click "Add" and Bob's your uncle.  :wink:
Perfect!
It works the way I wished.

Thanks a lot guys  :wink:
User avatar
FrizzleFry
Platinum Member
Platinum Member
Posts: 1255
Joined: 2005 Oct 16, 19:09

Post by FrizzleFry »

Kilmatead wrote:Hmm... rather odd - I just tried it again myself from the command line and it works now - but it definitely didn't work last night, whatever I was doing. :shrug:  That's what I get for never using the command bar - so much easier to just use buttons for repetitive tasks.  Apparently tokens are translated via the bar - learn something new every day. :D
Sometimes it is quicker to use the command line to run repetitive stuff since you can access the command line history with Ctrl-F10... no need for rodent use :)