Hello,
I'm using FM12 with structured docs. I'm looking to convert some Framescript into Extendscript language.
I finish my first Extendscript this morning (too me 3 days) : searching Element and saving the attributes value into a text file.
But I'm stuck converting my second one.
In a strutured doc, i want to wrap a selected text with a element "PRESS" into a element "PARA" (the element PRESS is allowed in the element PARA by the DTD/EDD).
My Framescript (FS 6.0)
Set vCurrentDoc = ActiveDoc;
Set vSelect = vCurrentDoc.TextSelection;
// Get the Element Def
Get Object NewVar(vEltDef) Type(ElementDef) Name('PRESS');
// Wrap the selected text
Wrap ElementDef(vEltDef);
// Select the new PRESS element
Set vPRESS = ElementSelection.begin.child;
// Create the attribs
New AttributeList NewVar(vPRESSatt) AttrName('SMALLCAPS') Value('1');
// Assign the Attributes to the tag
Set vPRESS.Attributes = vPRESSatt;
In Extendscript, how do i write it?
var vCurrentDoc = app.ActiveDoc;
var vSelect = vCurrentDoc.TextSelection;
// from here, i'm lost I can't wrap a text with the element i want.
Many thanks for considering my request.