Copy link to clipboard
Copied
Here is a pie-in-the-sky project that is way beyond my abilities. Anyone up for that challenge will have my (and probably other's) endless gratitude.
I would like a script that creates an "alt text" for graphics based on the text of its caption in the document.
The structure would be something along the lines of:
1. Enumerating each anchored frame that contains a graphic
a. Testing to see if a specific paragraph style follows the anchored frame
b. If exists, selecting the text of that specific paragraph style
c. Setting the "Alternate" object property of the anchored frame
So after most graphics we have a caption using a "Figure Title" paragraph style. The script should create the text like: "This image is a screen shot of " + figTitle. Then populate the Alternate field of the Object Attributes dialog box of the Object Properties of the anchored frame.
Copy link to clipboard
Copied
Milo--
While I'm not volunteering to write the script, I would encourage you to tackle it yourself. It is hardly a pie-in-the-sky project, and if you have any desire to expand your abilities, this would be a worthwhile exercise.
You've already taken the first step by outlining the basic structure.
There are several threads you might find useful in putting it all together
http://forums.adobe.com/thread/959627?tstart=0 --The main subject is about deleting aframes, but it spends a bit of time discussing how to iterate through all the frames in a document and determining their contents.
http://extendingframemaker.blogspot.com/2012/01/getting-elements-text.html --While the listed subject is getting text from an element, the approach is very similar to how you get text from a paragraph
http://forums.adobe.com/thread/926370?tstart=0 --Regarding setting attribute values