johnscott999 Posted November 16, 2020 Share Posted November 16, 2020 I’m working on a program to help manage my intake workflow, which in part groups hdr stack frames. I’d like to open Affinity programmatically in HDR stack mode having already specified the frames of the stack. I couldn’t find documentation on the command line interface, so I’m hoping the documentation is what’s missing, not the interface. Quote Link to comment Share on other sites More sharing options...
v_kyr Posted November 16, 2020 Share Posted November 16, 2020 On a Mac you can use the common "open" command with the "-a" option for indicating an application. For example: Quote > open -a "Affinity Photo" ~/Downloads/*.jpg ... which will start "Affinity Photo" and opens all JPG files from your "Downloads" directory. There should be something similar for the Windows console in order to pass over parameters to the app via CLI. - Though not sure if APh has a CLI option for going directly into HDR stack mode here. Quote ☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan ☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2 Link to comment Share on other sites More sharing options...
johnscott999 Posted November 16, 2020 Author Share Posted November 16, 2020 (edited) I’m spitballing here, but if this doesn’t exist it would be really helpful for automation. Something like > affinity open > affinity open c:/path/to/photo/or/project/file.afphoto Would open affinity, optionally with the specified file. the merge command would be able to specify mode (hdr, panoramic, focus stack, etc), take either a directory or an explicit list of files, and would either save the file as a *.afphoto or open affinity directly with the merged frames. > affinity merge focus -d=Path/to/folder/of/frames > affinity merge hdr —save-as=GeneratedStack.afphoto -f=file1.jpg -f=file2.jpg if the merge command returned a file path, you could pipe that onto the open command to open the in progress merge file once the merge is done > affinity merge pano -f=Photos/Raws/date/panoramic1 —save-to=photos/WIP/date/panoramic1.afphoto | affinity open would merge all frames in the Raws panoramic folder into a single panoramic, save the result as a affinity project in the WIP folder as panoramic1, and finally open the file in affinity for more editing when the merge is done. commands like this would mean after I’ve uploaded the raw files to my PC, I could have my program merge all of my hdr stacks and panoramics into project files at night, while I am sleeping, and the next morning review the merged files to pick my favorites or continue processing. Edited November 16, 2020 by johnscott999 Spelling Quote Link to comment Share on other sites More sharing options...
v_kyr Posted November 16, 2020 Share Posted November 16, 2020 If you are on Windows I don't think there is an "open" command, instead you may try to call the apps executable path and pass one or several filenames to that. - So more something like ... Quote c:\path_to affinity\"Affinity Photo.exe" file.jpg file2.jpg ... ...or... c:\path_to affinity\"Affinity Photo.exe" *.jpg johnscott999 1 Quote ☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan ☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2 Link to comment Share on other sites More sharing options...
v_kyr Posted November 16, 2020 Share Posted November 16, 2020 However, the one or other Affinity Win developer can tell you for more sure, if and what CLI commads/options/parameters are available for the Win apps here! johnscott999 1 Quote ☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan ☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2 Link to comment Share on other sites More sharing options...
johnscott999 Posted November 16, 2020 Author Share Posted November 16, 2020 (edited) 11 minutes ago, BofG said: If there's no CLI to do what you need, you might be able to still do it using something like Auto HotKey. It would be a bit of a fudge, but technically you can programmatically do anything in AP and the host OS that you want to. I prefer CLIs over that sort of automation since it takes over my computer while it’s running, and needs the pc to stay awake to run. Further, it is a lot harder to do error handling for shortcut automations. It’s definitely an option, but I’m hoping for something more robust Edited November 16, 2020 by johnscott999 Making it more polite Quote Link to comment Share on other sites More sharing options...
IanSG Posted November 16, 2020 Share Posted November 16, 2020 Just to make life difficult, even if the Windows version supports a CLI, the MS Store sandbox probably prevents it working. Quote AP, AD & APub user, running Win10 Link to comment Share on other sites More sharing options...
johnscott999 Posted November 16, 2020 Author Share Posted November 16, 2020 Good, point, though I think uninstalled my version directly instead of through the store. it looks like the windows version I have can accept command line arguments, but treats any argument as a file path to open I got the same message for each of the commands shown Quote Link to comment Share on other sites More sharing options...
v_kyr Posted November 16, 2020 Share Posted November 16, 2020 Or alternative ... Quote C:\Users\John> start "" "C:\Program Files\Affinity\Photo\Photo.exe" filename Though AFAI remember Affinity apps do support at least some app argument to dismiss the info panel on startup etc. beside supporting common file arguments. Quote ☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan ☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2 Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.