Pass file to Preview

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Native2904
Posts: 133
Joined: 23 Apr 2025 18:48
Location: Aachen

Pass file to Preview

Post by Native2904 »

Hello,

I wanted to ask if it’s possible to call the XY preview from the outside via command line?

Something like this:

Code: Select all

xyplorer.exe /preview
I have a batch file that generates a spectrogram for each of the same two songs from different sources with FFmpeg and then compares them with WinMerge… I really like WinMerge, but for a quick overview it’s too powerful. So I changed the script to place the two images vertically on top of each other and then open them, so I can quickly see which source has the better quality.

I use IrfanView for that, which is also great, but the XY preview can images "zoom2cursor", and I find this effect the fastest and most comfortable way for a quick comparison.

Code: Select all

set "irfanview=C:\Users\Home\Apps\IrfanView\i_view64.exe"
Is it possible to open this image with XYplorer’s preview?
I couldn’t find anything about it in the help at first glance.

Thank you in advance.
Last edited by Native2904 on 03 Apr 2026 11:14, edited 2 times in total.
Lts. 64-bit XY-Port. ƒ JetBrainsMono @ Windows 11 Pro 24H2 ▣ 1920x1080 ⇵ 115%
xytags4tc

highend
Posts: 14940
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Pass file to Quickview

Post by highend »

Quickview = Quick File View?

Run it with a script:

Code: Select all

focus 'L'; sendkeys ' '; wait 100; #177;
One of my scripts helped you out? Please donate via Paypal

Native2904
Posts: 133
Joined: 23 Apr 2025 18:48
Location: Aachen

Re: Pass file to Preview

Post by Native2904 »

Not Quick File View but Preview.

Sorry if I’m asking stupid questions out of impatience… but you can’t just mix two different syntaxes, right? How am I supposed to integrate that command into my batch file?

Code: Select all

@echo off
setlocal enabledelayedexpansion

set "file1=%~1"
set "file2=%~2"

set "out1=%TEMP%\spec1.png"
set "out2=%TEMP%\spec2.png"
set "final=%TEMP%\comparison.png"

set "ffmpeg=C:\Youtube\ffmpeg.exe"
set "xypreview=C:\XYplorer\XYplorer.exe /focus 'L'; sendkeys ' '; wait 100; #178;"
set "font=C:\Windows/Fonts/arial.ttf"

echo file1=%file1%
echo file2=%file2%
pause

set "name1=%~nx1"
set "name2=%~nx2"

REM Bild 1
"%ffmpeg%" -y -i "%file1%" ^
-filter_complex "[0:a]aformat=channel_layouts=mono,showspectrumpic=s=2048x800:legend=1:scale=log,drawtext=fontfile='%font%':text='%name1%':x=10:y=10:fontsize=24:fontcolor=white" ^
-frames:v 1 "%out1%"

REM Bild 2
"%ffmpeg%" -y -i "%file2%" ^
-filter_complex "[0:a]aformat=channel_layouts=mono,showspectrumpic=s=2048x800:legend=1:scale=log,drawtext=fontfile='%font%':text='%name2%':x=10:y=10:fontsize=24:fontcolor=white" ^
-frames:v 1 "%out2%"

REM Bilder stapeln
"%ffmpeg%" -y -i "!out1!" -i "!out2!" ^
-filter_complex "[0:v][1:v]vstack=inputs=2" ^
-frames:v 1 -update 1 "!final!"

REM Anzeigen
"%xypreview%" "!final!"
Lts. 64-bit XY-Port. ƒ JetBrainsMono @ Windows 11 Pro 24H2 ▣ 1920x1080 ⇵ 115%
xytags4tc

jupe
Posts: 3462
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Pass file to Preview

Post by jupe »

If you change %xypreview% to just the XY exe path, and then your last line to this:

"%xypreview%" /feed="::goto '!final!'; if (!<get #178>) { #178; }"

I think it should do what you require, but it is just aircode

Native2904
Posts: 133
Joined: 23 Apr 2025 18:48
Location: Aachen

Re: Pass file to Preview

Post by Native2904 »

thank you you for your script!
but unfortunately it doesn't run..
Last edited by Native2904 on 03 Apr 2026 11:11, edited 2 times in total.
Lts. 64-bit XY-Port. ƒ JetBrainsMono @ Windows 11 Pro 24H2 ▣ 1920x1080 ⇵ 115%
xytags4tc

jupe
Posts: 3462
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Pass file to Preview

Post by jupe »

Ah I just realized a possible issue when running from a bat, try the last line like this instead:

"%xypreview%" /feed="::goto '!final!'; if (<get #178> == 0) { #178; }"

Native2904
Posts: 133
Joined: 23 Apr 2025 18:48
Location: Aachen

Re: Pass file to Preview

Post by Native2904 »

yes :mrgreen: it runs fantastic...thank you many times 2jupe!

I think the image preview in XYplorer has so much more to offer than QuickLook or Seer... it’s a real hidden gem. (Just my personal opinion)
Lts. 64-bit XY-Port. ƒ JetBrainsMono @ Windows 11 Pro 24H2 ▣ 1920x1080 ⇵ 115%
xytags4tc

Post Reply