|
Author |
Message |
grizgg1
Joined: 17 May 2010
Posts: 4
|
Posted: Mon May 17, 2010 10:51 am Post subject: Keyword data |
|
|
Is there an action or script that is available, so when a file is opened in Photoshop, the keyword data can be automatically viewed in another window? I know it can be seen in Bridge, however I want a closable window that displays the metadata upon opening the file with out additional keystokes to get the the file info.
See EXAMPLE.jpg |
|
|
|
|
Paul R
Joined: 06 Apr 2010
Posts: 57
|
Posted: Mon May 17, 2010 11:34 am Post subject: |
|
|
All you need to do is set up File - Scripts - Script Events Manager to call this one line script on open document event.
Code: |
alert(activeDocument.info.keywords);
|
|
|
|
|
|
grizgg1
Joined: 17 May 2010
Posts: 4
|
Posted: Mon May 17, 2010 3:43 pm Post subject: Keyword data |
|
|
That worked great, thanks for the help |
|
|
|
|
thehermit
Joined: 05 Mar 2003
Posts: 3987
Location: Cheltenham, UK
|
Posted: Mon May 17, 2010 4:15 pm Post subject: |
|
|
GJ on the speedy answer Paul R _________________ If life serves you lemons, make lemonade! |
|
|
|
|
grizgg1
Joined: 17 May 2010
Posts: 4
|
Posted: Wed May 19, 2010 11:08 am Post subject: adding another window to the code |
|
|
If I want to add another window, i.e. the description window, to the script, do I just duplicate the code line and add description?
alert(activeDocument.info.keywords);
alert(activeDocument.info.description); |
|
|
|
|
Paul R
Joined: 06 Apr 2010
Posts: 57
|
Posted: Wed May 19, 2010 5:07 pm Post subject: |
|
|
Close, but this should be better...
Code: |
var doc = app.activeDocument.info;
alert(doc.keywords+"\r"+doc.caption);
|
Or with a bit of error checking you could use this..
Code: |
var dlg = new Window( 'dialog', 'Information' );
dlg.alignChildren="column";
dlg.p1= dlg.add("panel", undefined, undefined, {borderStyle:"black"});
dlg.p1.st1 = dlg.p1.add('statictext',undefined,'Keywords');
dlg.p1.st1.alignment='left';
dlg.p1.keys = dlg.p1.add('statictext',undefined,'No keywords');
dlg.p1.st2 = dlg.p1.add('statictext',undefined,'Description');
dlg.p1.st2.alignment='left';
dlg.p1.desc = dlg.p1.add('statictext',undefined,'No description');
var doc = app.activeDocument.info;
if(doc.keywords != '') dlg.p1.keys.text = doc.keywords.toString();
if(doc.caption != '') dlg.p1.desc.text = doc.caption;
dlg.p1.but = dlg.p1.add('button',undefined,'Okay');
dlg.p1.but.onClick = function(){
dlg.close(1);
}
dlg.center();
dlg.show();
|
|
|
|
|
|
grizgg1
Joined: 17 May 2010
Posts: 4
|
Posted: Thu May 20, 2010 7:43 am Post subject: Keywords |
|
|
Paul R., thanks again for your help, much appreciated! |
|
|
|
|
|