Fighting with Javascript, Extendscript, and Framemaker.

During the past week, I was given a new task to focus on – creating a script to automate the find and replace process that I’ll need to do in order to replace all the pesky instances of a font in our materials with variables.

edufont

An example of the font in question.

The nice visual indicators of what you’re supposed to do with the mouse, or what key you’re supposed to press, are actually glyphs in a font called Edufont.  It makes typing materials much quicker and gives participants an eye catching prompt for what they should be doing, but it’s not very accessible.  For example, to type up “click a specific thing on the screen”, click would be replaced by the keyboard combination Alt+0153 – which results in ™.  When a screen reader goes through the materials… I think you get the picture.  Trademark a specific thing on the screen makes very little sense.

So, the goal is to replace all those Edufont instances with text variables – still ensuring less typing, but with more accessibility.  Which brings me to the task I’ve been banging my head on for the past week – working with Extendscript, Adobe’s flavor of Javascript, to loop through the materials, find instances of particular Edufont uses, and replace them with text variables.  I’m a bit rusty on my Javascript, though.  Extendscript is a whole new world of functions and variables and references, and there aren’t really any tutorials out there for doing what I need to do.  So, I’m taking it step by step, starting very small, and working my way up to having a finished script that does what I need it to.  Right now, I’ve got a script that can pull strings out of an array and display them – next, I’ll be adding the functionality for the script to search through a document, find one string from the array, and replace it with another.  Again, baby steps here, but slow and steady makes the script, and makes for far less headaches.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s