Highlighted

How to insert Char Tab using Extendscript in Framemaker 12?

New Here ,
Mar 30, 2017

Copy link to clipboard

Copied

Hi,

I am currently trying to insert a Char tab into a new paragraph, I'd like to separate each variable I insert into the paragraph separated by a Char Tab.

I am updating an existing mif file. I am trying to figure how to insert the <Char Tab> using Extend Script.

Any help would be appreciated.

Thanks,

Sebin

======================================================

Existing Mif File Screenshot:

        <String `Attribute1: '>

        <Variable

         <VariableName `Variable_1'>

         <Unique 6767868>

        > # end of Variable

        <Char Tab>

        <String `Attribute2: '>

        <Variable

         <VariableName `Variable_2'>

         <Unique 6767812>

        > # end of Variable

        <Char Tab>

Adobe Community Professional
Correct answer by frameexpert | Adobe Community Professional

#target framemaker

var doc = app.ActiveDoc;

// Make a variable for the paragraph containing the text cursor.

var pgf = doc.TextSelection.beg.obj;

// Make a text location variable at the beginning of the paragraph.

var textLoc = new TextLoc (pgf, 0);

// Insert a tab character in the paragraph.

doc.AddText (textLoc, "\x08");

TOPICS
Scripting

Views

312

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

How to insert Char Tab using Extendscript in Framemaker 12?

New Here ,
Mar 30, 2017

Copy link to clipboard

Copied

Hi,

I am currently trying to insert a Char tab into a new paragraph, I'd like to separate each variable I insert into the paragraph separated by a Char Tab.

I am updating an existing mif file. I am trying to figure how to insert the <Char Tab> using Extend Script.

Any help would be appreciated.

Thanks,

Sebin

======================================================

Existing Mif File Screenshot:

        <String `Attribute1: '>

        <Variable

         <VariableName `Variable_1'>

         <Unique 6767868>

        > # end of Variable

        <Char Tab>

        <String `Attribute2: '>

        <Variable

         <VariableName `Variable_2'>

         <Unique 6767812>

        > # end of Variable

        <Char Tab>

Adobe Community Professional
Correct answer by frameexpert | Adobe Community Professional

#target framemaker

var doc = app.ActiveDoc;

// Make a variable for the paragraph containing the text cursor.

var pgf = doc.TextSelection.beg.obj;

// Make a text location variable at the beginning of the paragraph.

var textLoc = new TextLoc (pgf, 0);

// Insert a tab character in the paragraph.

doc.AddText (textLoc, "\x08");

TOPICS
Scripting

Views

313

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Mar 30, 2017 0
Adobe Community Professional ,
Mar 30, 2017

Copy link to clipboard

Copied

You should be able to use "\x08".

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 30, 2017 0
New Here ,
Mar 30, 2017

Copy link to clipboard

Copied

Hi,

Could you also let me know how to use it? What function should I invoke to insert the tab?

I'm not sure how to use the 'Tab' function.

Thanks,

Sebin

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 30, 2017 0
Adobe Community Professional ,
Mar 30, 2017

Copy link to clipboard

Copied

#target framemaker

var doc = app.ActiveDoc;

// Make a variable for the paragraph containing the text cursor.

var pgf = doc.TextSelection.beg.obj;

// Make a text location variable at the beginning of the paragraph.

var textLoc = new TextLoc (pgf, 0);

// Insert a tab character in the paragraph.

doc.AddText (textLoc, "\x08");

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 30, 2017 0
New Here ,
Apr 03, 2017

Copy link to clipboard

Copied

Thank you so much! It worked!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 03, 2017 0
Adobe Community Professional ,
Apr 03, 2017

Copy link to clipboard

Copied

Please mark my answer as correct. Thank you.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 03, 2017 0