Menu

#67 multiple images not opening on a single instance . "SingleInstance=true" setting not working.

Next release
open
nobody
None
5
2021-09-07
2021-09-06
Greg Dillon
No

Suppose there are 50 images in a folder. I want to be able to select a few (say 3) in the windows explorer and when i hit enter to open the images in JPEGVIEW, i only want those 3 images to open in a single JPEGVIEW instance so that when i click on "show next image" or use arrow keys, only those 3 images keep looping.

Right now when i hit enter after selecting say 3 images, 3 different instances of JPEGVIEW are open and when i click next image on any of the 3 images, all the images in the folder keep looping.

I have already set "SingleInstance=true" & "SingleFullScreenInstance=true" in the user settings, but nothing happens. Multiple instances always open.

Please help.
I deleted the program and the ini files in the %APPDATA% folder and then installed again. Still same problem.

Discussion

  • Greg Dillon

    Greg Dillon - 2021-09-06

    wow i cant edit or delete a ticket!

    OK so "SingleInstance=true" & "SingleFullScreenInstance=true" settings ARE working. I didn't understand their true function.
    But multiple selected images are still not opening on a single instance and looping like i wrote in the ticket.

     
  • Melvin Nava

    Melvin Nava - 2021-09-07

    You can create a text file with list of image paths and open that text file with JPEGView.. it will loop thru those images, given that they exist.

    JPEGView filelist.txt

    You could make a batch file, a VBSript or other script to create the file list automatically from a selection.. Keep in mind that if you use a Windows context menu for this purpose, each file you select in explorer is sent to the destination program individually and thus it can't be used to create file lists. You'd need yet another tool (like singleinstance.exe) to be able (from context menus) to send multiple files at once to the script that creates the file list.

    Example .reg file to create a context menu to open image lists:

    Windows Registry Editor Version 5.00
    ; ============================================
    ; File: Context.reg
    ; This requires the utility "singleinstance.exe" to work
    ; So the context menu sends multiple files to OpenImages.vbs
    ; Otherwise each selected file will be sent separately..
    ; ============================================
    
    [HKEY_CLASSES_ROOT\SystemFileAssociations\image\Shell\AB.FileList]
    @="Open files with JPEGView"
    "Icon"="\"D:\\path\\yo\\JPEGView64\\JPEGView.exe\",0"
    [HKEY_CLASSES_ROOT\SystemFileAssociations\image\Shell\AB.FileList\command]
    @="D:\\path\\to\\context-menu-launcher\\singleinstance.exe \"%1\" \"D:\\path\\to\\script\\OpenImages.vbs\" $files --si-timeout 400"
    

    Example VBScript to create an image list and open it with JPEGView (I did not test it):

    '+============================================
    '| File: OpenImages.vbs
    '| Date: 2021-09-06 19:42
    '| Last: 2021-09-06 19:42
    '+============================================
    Option Explicit
    Dim objShell, objStream, arrArgs, sArg, sFileAppend, pTmpFileList
    Set objShell    = CreateObject("WScript.Shell")
    Set objStream   = CreateObject("ADODB.Stream")
    Set arrArgs     = WScript.Arguments
    sRunCmd         = "D:\path\to\JPEGView64\jpegview.exe"
    sFileAppend     = ""
    pTmpFileList    = "%TEMP%\temp_image_list.txt"
    
    For Each sArg In arrArgs
        sFileAppend = sFileAppend & " " & sArg
    Next
    
    objStream.CharSet = "utf-8"
    'objStream.CharSet = "iso-8859-1"
    objStream.Open
    objStream.WriteText sFileAppend
    objStream.SaveToFile pTmpFileList, 2
    objStream.Close
    
    objShell.Run sRunCmd & " " & pTmpFileList, 9, False
    
    Set objShell    = Nothing
    Set objStream   = Nothing
    

    Something like this should allow you to select files from context menus and open them with JPEGView in a loop. If you decide to use it, make sure to add some file path validation.

    If you still want to use the ENTER key for this purpose the VBScript file should be replaced with an AutoHotkey script (.ahk) that handles the ENTER hotkey, creates the image list and opens JPEGView.

     

    Last edit: Melvin Nava 2021-09-07

Log in to post a comment.

MongoDB Logo MongoDB