Anyone Write any Good Scripts for XnView?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
BGM
Posts: 507
Joined: 20 Nov 2013, 20:56
Contact:

Anyone Write any Good Scripts for XnView?

09 Jun 2015, 21:11

Say, has anyone written any interesting scripts for use with XnView?

I use XnView all the time, and wish it had a button to open a particular folder and sort by date and scroll to the bottom (I wrote this in powerpro, not ahk, and it works so-so like).
So I was just wondering if anyone had done something similar.
User avatar
TheDewd
Posts: 1513
Joined: 19 Dec 2013, 11:16
Location: USA

Re: Anyone Write any Good Scripts for XnView?

11 Jun 2015, 08:13

I downloaded XnView just to create this script. I had never used it before today.

The script works well for me so far. You will of course need to edit the location to your images and the path to the xnview.exe executable file.

Code: Select all

; =======================================================================================
; Name .........: XnView Sort and Scroll
; Description ..: Open XnView to a specific directory and then scroll to the bottom
; AHK Version ..: AHK_L 1.1.22.02 (Unicode 32-bit) - May 27, 2015
; Platform .....: Windows 7 Professional SP1 64-bit
; Language .....: English (en-US)
; Author .......: TheDewd
; Modified .....: 2015-06-11 08:11:30
; =======================================================================================

; Global ================================================================================
#SingleInstance, Force ; Allow only one running instance of script
#Persistent ; Keep script permanently running until terminated
#NoEnv ; Avoid checking empty variables to see if they are environment variables
#Warn ; Enable warnings to assist with detecting common errors
;#NoTrayIcon ; Disable the tray icon of the script
SendMode, Input ; Recommended for new scripts due to its superior speed and reliability
SetWorkingDir, %A_ScriptDir% ; Change the working directory of the script
SetBatchLines, -1 ; Run script at maximum speed
; =======================================================================================

; Script ================================================================================
Run, xnview.exe "C:\Windows\Web\Wallpaper\Windows Featured"

Loop
{
	IfWinActive, ahk_exe xnview.exe ; ahk_class XmainClass
	{
		WinMenuSelectItem, ahk_exe xnview.exe,, View, Sort By, Date
		Break
	}
	Sleep, 500
}
ControlSend, SysListView321, {End}, ahk_exe xnview.exe

Return ; End automatic execution
; =======================================================================================
Last edited by TheDewd on 12 Jun 2015, 12:15, edited 1 time in total.
User avatar
TheDewd
Posts: 1513
Joined: 19 Dec 2013, 11:16
Location: USA

Re: Anyone Write any Good Scripts for XnView?

11 Jun 2015, 09:27

I have also discovered that you can add your own toolbar items.

See the screenshot below where I have added a toolbar item and pointed it to a script file, and also used a custom icon. Tested and works on my Windows 7 machine.

Script: ScrollToBottom.ahk

Code: Select all

#NoTrayIcon
ControlSend, SysListView321, {End}, ahk_exe xnview.exe
ExitApp
Image
User avatar
BGM
Posts: 507
Joined: 20 Nov 2013, 20:56
Contact:

Re: Anyone Write any Good Scripts for XnView?

20 Jun 2015, 14:31

Ah, well, I already had a button to do this kind of thing, but had made it with powerpro;
the autohotkey routine works like a charm though.
Thanks for your time!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: arrondark, gongnl and 237 guests