Jump to content
ggt667

I'm on a Mac I have my own DAM( Digital Assets Management ) tool

Recommended Posts

I would like to be able to make the selection of n images in the DAM( Think Aperture as a cataloging tool, but no editing, ) and would like to add a function there to open the current selection of images as *[ a stack ] in Affinity Photo.

How?

Can I call Affinity remote?

 

Where the content of *[ ] could be anything that would benefit the user, such as:

[ append selection to frontmost workspace ]

[ open selected files individually ]

Share this post


Link to post
Share on other sites

Hi ggt667 :)

Other external DAMs (such as Lightroom) are able to open images in Affinity Photo, so I see no reason why you could not use something like the following command in terminal to launch an image in Affinity:

open -a "Affinity Photo.app" test.jpg

Replace test.jpg with the file name and add the file location - this should open the image in Affinity Photo.
I tested the above code in terminal with test.jpg on the desktop and it functioned as expected. I hope this helps!

Share this post


Link to post
Share on other sites

@ggt667, if you are interested in using Terminal for your project as @Dan C suggests, you might find it useful to refer to the OPEN(1) man page for the available options. You probably already know how to open a man page in Terminal, but you may not know you can use Terminal to open a man page in Preview.app, which allows you to save the page as a PDF file, which might be more convenient.

So for example, the following will open OPEN(1) in Preview on a Mac:

man -t open | open -f -a /Applications/Preview.app

Either way, it should be obvious that you can open selected files individually by adding their paths after the first file reference (test.jpg in the example), but while you can pass any −−args you want to Affinity Photo in the command, Affinity Photo probably will ignore them, meaning you won't be able to add them as a stack or anything like that.


Affinity Photo 1.7.1 & Affinity Designer 1.7.1; macOS High Sierra 10.13.6 iMac (27-inch, Late 2012); 2.9GHz i5 CPU; NVIDIA GeForce GTX 660M; 8GB RAM
Affinity Photo 1.7.0.135 & Affinity Designer 1.7.0.9 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iOS 12.3.1

Share this post


Link to post
Share on other sites
7 hours ago, R C-R said:

...but you may not know you can use Terminal to open a man page in Preview.app, which allows you to save the page as a PDF file, which might be more convenient.

Or you may not know, that there are even tools like ManOpen and ManDrake which are even more comfortable to use here, especially also when writing own man pages and also when previewing existing ones. Those tools can aslo easily save to PDF or even do convert a man page into HTML (ManDrake). ;)

manopen.thumb.jpg.79141f92e17ccc9aac6f4ef0a65d80e7.jpg

mandrake.thumb.jpg.9536e08bf11f9be6b1f1556265a3a4e5.jpg


☛ Affinity Designer 1.7.0 ◆ Affinity Photo 1.7.0 ◆ OSX El Capitan

Share this post


Link to post
Share on other sites
9 hours ago, Dan C said:

Hi ggt667 :)

Other external DAMs (such as Lightroom) are able to open images in Affinity Photo, so I see no reason why you could not use something like the following command in terminal to launch an image in Affinity:


open -a "Affinity Photo.app" test.jpg

Replace test.jpg with the file name and add the file location - this should open the image in Affinity Photo.
I tested the above code in terminal with test.jpg on the desktop and it functioned as expected. I hope this helps!

There are no issues opening 1 - one file, the issue is that I would like to open a selection in context.

I assume this will require som AppleEvents or parameters on the Affinity Photo side of things.

Share this post


Link to post
Share on other sites
17 minutes ago, ggt667 said:

There are no issues opening 1 - one file, the issue is that I would like to open a selection in context.

I assume this will require som AppleEvents or parameters on the Affinity Photo side of things.

The APh app does handle several image files when those are passed as arguments via a terminal call, for example ...

Quote

open -a "Affinity Photo.app" file1.jpg file2.jpg file3.png ...

... so it's a matter how it's called from the DAM software via a selection of files. And how the selected files (path/name) are passed over then, in which order etc.


☛ Affinity Designer 1.7.0 ◆ Affinity Photo 1.7.0 ◆ OSX El Capitan

Share this post


Link to post
Share on other sites

Good, that is not an issue, how can I say that this selection should be a stack?

 

There must be something like:

Quote

open -a "Affinity Photo.app -stack" file1.jpg file2.jpg file3.png ...

or

Quote

open -a "affphoto:///file/tmp&file1.jpg&file2.jpg&file3.png&-generatestack

or similar

 

Not sure what `affinity-photo://` does.

Share this post


Link to post
Share on other sites
25 minutes ago, v_kyr said:

Or you may not know, that there are even tools like ManOpen and ManDrake ...

I have used ManOpen for years. It has not been updated since 2012 but it still runs fine on High Sierra. I mentioned the Preview trick because some users might not want to add anything new to their system.


Affinity Photo 1.7.1 & Affinity Designer 1.7.1; macOS High Sierra 10.13.6 iMac (27-inch, Late 2012); 2.9GHz i5 CPU; NVIDIA GeForce GTX 660M; 8GB RAM
Affinity Photo 1.7.0.135 & Affinity Designer 1.7.0.9 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iOS 12.3.1

Share this post


Link to post
Share on other sites
2 minutes ago, ggt667 said:

how can I say that this selection should be a stack?

AFAIK, you can't. That would require passing an arg (argument) to Affinity Photo & like I mentioned earlier I think AP would just ignore it. I doubt there is a way to do it with AppleScript either, because Affinity Photo only responds to the minimum required AppleScript verbs (like to open files or launch or quit the app).


Affinity Photo 1.7.1 & Affinity Designer 1.7.1; macOS High Sierra 10.13.6 iMac (27-inch, Late 2012); 2.9GHz i5 CPU; NVIDIA GeForce GTX 660M; 8GB RAM
Affinity Photo 1.7.0.135 & Affinity Designer 1.7.0.9 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iOS 12.3.1

Share this post


Link to post
Share on other sites
15 minutes ago, R C-R said:

I have used ManOpen for years. It has not been updated since 2012 but it still runs fine on High Sierra. I mentioned the Preview trick because some users might not want to add anything new to their system.

Sometimes oldies are still goldies, loved that since it resembled what I've used for years on NeXTstep/OpenStep in the pasts!

Though I once wrote my own man page tool (something in behavior more like ManDrake) also in a more platform portable manner (runs nearly everywhere).

filemenu.gif.3c05017a7417d8cddaf3179c30883967.gifcontextmenu.gif.d19599456bf37fdcddb3b6765b5c6516.gif

combocompletion.gif.916f237919ee682841386636d34b2621.gif

abbreviations.gif.1460b3eaeb2b23dbb99f5cc1d2c8cd23.gif

mwscreen.jpg.66fc270290fbcbca36fdbc6f72e00dd4.jpg


☛ Affinity Designer 1.7.0 ◆ Affinity Photo 1.7.0 ◆ OSX El Capitan

Share this post


Link to post
Share on other sites
9 hours ago, R C-R said:

@ggt667, if you are interested in using Terminal for your project

I do prefer to use NSWorkspace or link protocols; such as ```affinity-photo```, perhaps protocols could be added like: ```affinity-photo-stack```

```affinity-photo-develop```

```affinity-photo-export```

```affinity-photo-appendSelectionToFrontmostWorkspaceAsLayers```

```affinity-photo-and```

```affinity-photo-so```

```affinity-photo-on```

 

Share this post


Link to post
Share on other sites
On 3/26/2019 at 10:28 AM, Dan C said:

Hi ggt667 :)

Other external DAMs (such as Lightroom) are able to open images in Affinity Photo, so I see no reason why you could not use something like the following command in terminal to launch an image in Affinity:


open -a "Affinity Photo.app" test.jpg

Replace test.jpg with the file name and add the file location - this should open the image in Affinity Photo.
I tested the above code in terminal with test.jpg on the desktop and it functioned as expected. I hope this helps!

In essence I would like to do

Quote

open -a "Affinity Photo.app" GGT_14802.NEF GGT_14803.NEF GGT_14807.NEF GGT_14809.NEF GGT_14812.NEF GGT_14815.NEF GGT_14817.NEF GGT_14833.NEF -asStack

 

Share this post


Link to post
Share on other sites
25 minutes ago, ggt667 said:

I essence I would like to do ...

I suspect that would require Serif adding a fairly extensive set of API's to the app, along with sufficient documentation to use them. My guess is that will never happen, or at least not in the foreseeable future, for several reasons. Among them:

  • Much of the app is considered to include proprietary trade secrets, so Serif is unlikely to make anything that reveals them publicly available.
  • One of the goals for the Affinity apps is cross-platform parity, so unless they could add an equivalent set of API's to the Windows version, they probably would not be interested in making this a Mac-only feature.
  • It would most likely require major revisions to the code base, which would have implications for the other Affinity apps that share it, which in turn would require a lot of testing to make sure it all worked without introducing bugs in any of the apps.
  • It isn't likely to be something many users would take advantage of, so it would be hard to justify the time & money required to develop & support it.

Affinity Photo 1.7.1 & Affinity Designer 1.7.1; macOS High Sierra 10.13.6 iMac (27-inch, Late 2012); 2.9GHz i5 CPU; NVIDIA GeForce GTX 660M; 8GB RAM
Affinity Photo 1.7.0.135 & Affinity Designer 1.7.0.9 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iOS 12.3.1

Share this post


Link to post
Share on other sites
2 hours ago, ggt667 said:

I do prefer to use NSWorkspace or link protocols; such as ```affinity-photo```, perhaps protocols could be added like: ```affinity-photo-stack```

```affinity-photo-develop```

```affinity-photo-export```

```affinity-photo-appendSelectionToFrontmostWorkspaceAsLayers```

```affinity-photo-and```

```affinity-photo-so```

```affinity-photo-on```

 

Well generic things like ...

NSWorkspace.shared.openFile("/Myfiles/myfile.jpg", withApplication: "Affinity Photo")

... for launching the Affinity app from an own app and passing over a file as argument should work , since it's nothing Affinity specific here. - For other (maybe) accessible services it's difficult to tell what might be already there to reuse or not, since nothing is documented or ever propagated. AFAIK there is no real programmers API or the like available. Also the CLI access is limited to just open as args passed over files in single windows. I doubt other things like batch processing, stacking etc. are somehow made available via services here.


☛ Affinity Designer 1.7.0 ◆ Affinity Photo 1.7.0 ◆ OSX El Capitan

Share this post


Link to post
Share on other sites

I would prefer an approach like this:

Quote

let currentURL: URL = URL( string: "affinity-photo-stack:///media/GGT_14802.NEF&/media/GGT_14803.NEF&/media/GGT_14807.NEF&/media/GGT_14809.NEF&/media/GGT_14812.NEF&/media/GGT_14815.NEF&/media/GGT_14817.NEF&/media/GGT_14833.NEF" )!

_ = NSWorkspace.shared.open(
                [ currentURL ],
                withAppBundleIdentifier: "com.seriflabs.affinityphoto",
                options: .andHideOthers,
                additionalEventParamDescriptor: nil,
                launchIdentifiers: nil
            )

 

Share this post


Link to post
Share on other sites
39 minutes ago, ggt667 said:

I would prefer an approach like this:

If support for that is something you want added to Affinity Photo, you can try adding a request for it in the Suggestions for Affinity Photo on Desktop forum, but for the reasons already mentioned it does not seem likely it will be implemented anytime soon, if ever.


Affinity Photo 1.7.1 & Affinity Designer 1.7.1; macOS High Sierra 10.13.6 iMac (27-inch, Late 2012); 2.9GHz i5 CPU; NVIDIA GeForce GTX 660M; 8GB RAM
Affinity Photo 1.7.0.135 & Affinity Designer 1.7.0.9 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iOS 12.3.1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×