Skip to main content
Loic.Aigon
Legend
March 5, 2012
Question

Use Bridge DOM from an AIR app…

  • March 5, 2012
  • 2 replies
  • 1426 views

Hi all,

A customer of mine wishes to have a widget to help their users deal with XMP metadata. However they don't want them to use bridge because the principe is to make the tasks as easy as possible.

But bridge has a convenient library to edit XMP so my ambition is to find a way to get access to Bridge DOM from outside.

Unfortunately, I can't see much workarounds. No command line, using #target bridge generates a prompt, applescript provides a do javascript" but only with strings and my first attemps scared me a bit ( working alternatively without reasons).

So question is, do you know if it's possible to run js script for bridge from outside BRIDGE ?

TIA Loic

This topic has been closed for replies.

2 replies

Inspiring
March 5, 2012

Loic, I take it that you are going to be using mac as you mention AppleScript… Any kind of scripting Bridge is going to kick it into an active process bridgetalk too… You can't use Bridge in any kind of invisible state and on the mac OS it vary anoyingly loads a window… ( wow I hate this behavour it makes me mad!!! ) Can you not do what you want from command line with EXIF tool? At least this should be fast and faceless…? Other than that there is an external XMP library that can be loaded in all app scripts… Page 257 Tools Guide…

Loic.Aigon
Legend
March 5, 2012

Hi Mark, Paul,

Thanks a lot for your great inputs. My main issue is that I wish I could use the external XMP library outside of the CS apps context. The UI is an air app that should concentrate some XMP fields and allows custom fields addition to a selection of files.

Reading you, I understand this is a deadend (given no invisibity) :\

Regarding to exif-tool, It looks like a great tool indeed. I gave it a try today. Reading datas is a piece of cake but unless I am wrong adding custom datas is much more complex. It looks like we need to run perl scripts ? Right ?

Also, another part of the request is some resize/resampling operations, couldn't find if exif allowed it.

Thanks again for your tips,

Loic

Inspiring
March 6, 2012

Paul has given you an example of using the loaded external library but it needs to be run in some app 's script engine and that didn't sound like what you want… EXIF tool should allow do deal with file XMP sorry but I have never added custom with it myself… As for resizing you could look at SIPS depending on file types… I have seen a thread about running Photoshop GUIless with ExtendScript and a sample of doing this in one of the app supplied scripts… The image needs to be edited using Photoshop's action manager code though… Are you familiar with that? If you looked at how that works the loaded library could work there too?

Paul Riggott
Inspiring
March 5, 2012

Hi Loic, yes it's possible but only going via Photoshop and BridgeTalk.

But it you have Photoshop CS4 or better you have the same functionality using Photoshop.

As an example this function will return the profile for a given file.

#target photoshop

function getProfile(file){
if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
var xmpf = new XMPFile( File(file).fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_READ);
var xmp = xmpf.getXMP();
return xmp.getProperty(XMPConst.NS_PHOTOSHOP,"ICCProfile");
}

You can read/update any field as well.

On a windows machine all this could be accessed via COM IE: Visual C# and Photoshop could be opened Invisible.