Read Notes by script (not only write by script)

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

User avatar
pedro.marques
Posts: 8
Joined: Fri Aug 19, 2016 2:24 pm
Location: Portugal

Read Notes by script (not only write by script)

Post by pedro.marques »

I'm using scripts to count annotations, to create and add text, color, author to each note created on a image in photoshop.
But it isn't possible to get the content text of a note using scripts.

For example, there is an option when using the "PDF presentation" inner script to add the notes to acrobat PDF notes. This is working and it is great!
But it means also that it is possible, somehow, to read the content of each note to put it in a pdf annotation!

So the inner script "PDF presentation" does read the text of the notes!

If there is only a 'set' and not a 'get' on the listener, why is a get for the PDF presentation inner script?
User avatar
jaydoubleyou80
Posts: 20
Joined: Mon Oct 17, 2016 1:41 pm
Location: USA

Re: Read Notes by script (not only write by script)

Post by jaydoubleyou80 »

According to the great Mike Hale, circa 2010, there is no direct access to notes or annotations.

https://forums.adobe.com/thread/663347

I'm not sure if the metadata solution would work for you, but I've seen it mentioned in numerous places.

https://stackoverflow.com/questions/163 ... t-with-jsx
User avatar
pedro.marques
Posts: 8
Joined: Fri Aug 19, 2016 2:24 pm
Location: Portugal

Re: Read Notes by script (not only write by script)

Post by pedro.marques »

Thanks JayW,

in my case I need to use the data only on the app, even if I got it from some of the images opened.
So, I'm using $.setenv() and later $.getenv()
User avatar
Jaroslav Bereza
Posts: 38
Joined: Tue Dec 27, 2016 7:22 pm

Re: Read Notes by script (not only write by script)

Post by Jaroslav Bereza »

yes... this code should get first annotation descriptor but it fails. Notes seems to be write-only.

Code: Select all


var ref = new ActionReference();
var idannotation = stringIDToTypeID( "annotation" );
ref.putIndex( idannotation, 0 );
var desc = executeActionGet(ref);