Affinity photo as external editor - how to

Hi
Try to indicate Affinity Photo as external editor in preferences. Yes I’ve read the Rawpedia, but can’t figure out how to… (sorry : new on Mac Osx)
Thanks in advance to help me out

Set the full path to Affinity in the external editor field in the pefrences.

Thanks, but this doesn’t help me any further. How to know the full path to Affinity ?

Found how to copy path to an application on Mac Osx El Capitan. Did this for Affinity, but doesn’t seem to work. Maybe I’m copying the wrong path…

I don’t have OSX but from what I know you can start any application from command promp by “open APPLICATIONNAME” and to find the application names this article could of help - I hope

But then I’m not sure.

What is the path you copied? Are you getting any errors?

@peterdb I don’t have OS X, but this is likely to work:

  1. Find out the name of the Affinity Photo executable. In a console, type:
    affinity[tab][tab]
    The tab will auto-complete the word, in case the executable’s name is more than just “affinity”, maybe “affinity-photo” or “affinityphoto” etc. Once you have the full name, hit enter to run it. If it runs, you got the right name. If it does not, for example if “affinity[tab][tab]” doesn’t auto-complete it, then maybe try “Affinity[tab][tab]” with a capital “A”.
  2. Find out the full path to the executable. Once you found the name of the executable in step 1, find out the full path to it using the “whereis” command. For example if the result of step 1 ends up being “AffinityPhoto.app”, then type:
    whereis AffinityPhoto.app
  3. Now check whether files can be passed as arguments to the executable. Assuming you have a sample image in /home/peter/a photo.jpg and that the result of step 2 was “/Applications/AffinityPhoto.app”, type:
    /Applications/AffinityPhoto.app "/home/peter/aphoto.jpg"
    Note that the photo path is surrounded by quotation marks (parentheses).
    Affinity Photo should open with your photo loaded.
  4. Enter the full executable path from step 2 into Preferences > External Editor, probably without parentheses, e.g.:
    /Applications/AffinityPhoto.app

Code: https://github.com/Beep6581/RawTherapee/blob/master/rtgui/extprog.cc#L323

Hi,
the path tat I copied is
/Applications/Affinity Photo Trial.app
Using this in RT gives the error : ‘cannot start editor / please set the correct path in preferences’
So probably have to copy another path within the affinity map in Finder… Any ideas ?

Yes: do that long thing I wrote, especially point 3, and report if it goes wrong with detailed info.

Thank you Morgan, but seems to complicated for my still limited knowledge of Osx.
Martin : thanks for the link. Tried that out and came to the same path : /Applications/Affinity Photo Trial.app.
I’ll sent an email to the developers of Affinity too. Could the reason be that I’m using a trialversion of Affinity for now ?

Further information
I can indicate Affinity as an external editor in for example Nikon View Nxi. I checked the path there used and it’s the same as described above. RT seems not to handle this.

have you tried to start affinity from command prompt?

I think it would be:
open -a “/Applications/Affinity Photo Trial.app”

not sure about whether to use the " or not, just thinking because of the blank in the app name.

1 Like

I turned on my Mac and got it to work.

The path you need is /Applications/Affinity\ Photo\ Trial.app/Contents/MacOS/Affinity\ Photo\ Trial

It seems that Affinity does not like being asked to open more than once though, which I’m sure will be annoying. And of course, the path will change, I’m guessing, if you buy the full version.

This works as well and doesn’t crash Affinity when opening multiple photos as my command above does.

1 Like

@Morgan_Hardwood

comparing those lines in the source code you have linked

line 302:
#elif defined __APPLE__ const auto cmdLine = Glib::ustring("open -a \'") + Glib::build_filename(options.psDir, "Photoshop.app\' ") + Glib::ustring("\'") + fileName + Glib::ustring("\'");
and line 321:

#elif defined __APPLE__ const auto cmdLine = options.customEditorProg + Glib::ustring(" \"") + fileName + Glib::ustring("\"");
and asuming starting apps in osx is always the same way, then this “open -a” would be needed to be typed in for all other apps.

and as options.customEditorProg of line 321 is not put in “” those would have to be typed in as well.

ups, a little too slow as @paperdigits found it already, sorry

Sorry, I’m just guessing

Thanks to everyone for helping me out.
The solution from Martin seems to be the best. You can indeed open multiple files this way in Affinity without crashing it.

What a great community here at RT !

cheers

So what’s the simplest command-line which works in RT? Simplest = not using unnecessary quoting or escaping. Is it:
/Applications/Affinity Photo Trial.app

The simplest command line would be
open -a "Affinity Photo Trial"
The quotes are mandatory because of the spaces in the name but otherwise can be omitted, e.g.
open -a RawTherapee
Note that the full path and .app extension are NOT necessary if the app is in the standard /Applications folder where the OS expects it to be.

Calling
/Applications/RawTherapee.app
from the command line will NEVER work, because RawTherapee.app is not an executable file, it’s a directory containing all the executables, runtime libraries, icons, configs etc. that the software needs. (Apple call it a ‘package’, or ‘app bundle’, it requires a specific folder structure and certain files to exist, but it’s still ultimately a directory).

If you want to run the executable itself, than that’s usually placed inside the .app directory in the /Contents/MacOS subdirectory, e.g.
/Applications/RawTherapee.app/Contents/MacOS/rawtherapee
Unfortunately, in my experience trying to run an app by directly calling it’s executable binary usually ends up with some sort of issues, sometimes not running at all. I think when you try to do it that way, not all the required resourced in the .app directory are properly loaded, but I’m not sure.
(it does work sometimes, and of course programs that are just one single executable binary, e.g. ffmpeg, can be used in typical unix command line style

Thanks @ion12, RawPedia updated:
http://rawpedia.rawtherapee.com/Preferences#External_Editor

1 Like

Thanks for updating Rawpedia.
I will post solution on the Affinityforum as well.