Copy link to clipboard
Copied
How to get the typefi element lying in a table?
Copy link to clipboard
Copied
it is an anchored typefi element and i want to select the row of the table
Copy link to clipboard
Copied
I'd suggest you are doing a screen capture of the situation with hidden text showing, edges showing and post it as an inline image here.
Use the forum's controls for this:
Uwe
Copy link to clipboard
Copied
Uwe,
This is my code:--
(function(){
// To test the script interactively, uncomment the following line
// and select one of the story's text frames.
//TYPEFI = {inddSpillFrame: app.selection[0]};
var mSel = app.selection[0],
mCheck = mSel instanceof Table || mSel instanceof Document;
while (!mCheck) {
mSel = mSel.parent;
mCheck = mSel instanceof Table || mSel instanceof Document;
}
var i;
var found;
var typefitextFLines;
var objFrame;
app.findGrepPreferences = null;
​app.findGrepPreferences.findWhat = '~a';
found = app.documents[0].findGrep();
//~ app.findGrepPreferences = null;
//~ app.findGrepPreferences.findWhat = '~a';
//~ found = TYPEFI.inddSpillFrame.parentStory.findGrep();
for (i = found.length-1; i >= 0; i--){
if (found.pageItems[0].typefiSettings.element.name== "equ"){
found.leading = Leading.AUTO;
found.textFrames[0].textWrapPreferences.textWrapMode = TextWrapModes.JUMP_OBJECT_TEXT_WRAP;
}
else if (found.pageItems[0].typefiSettings.element.name== "T_equ"){
var mu= found.parent.parentRow;
alert();
//~ // Paragraph:
//~ found.paragraphs[0];
//~ // Page:
//~ found.parentTextFrames[0].parentPage;
}
}
}());
it is an anchored typefi element.This script is working fine on all other typefi elements which are not lying inside a table.
But this doen't work on the typefi element lying on the table..
I want to select that row on which that typefi element is lying, and then i want to increase that row height..
Copy link to clipboard
Copied
[ Moved to InDesign Scripting ]
Copy link to clipboard
Copied
khkremer wrote:
[ Moved to InDesign Scripting ]
Thank you.
Hello harishbisht,
I would contact the developers at Typefi and ask for a solution there.
Uwe
Copy link to clipboard
Copied
Hi Harishbisht,
Assuming inddObject is a typefi float:
inddObject.typefiSettings.element.anchor would return a TypefiElementAnchor.
then
myAnchor.pageItem would return a GraphicLine that is the anchor's in-page representation, so the parent of that Graphic line is a character.
In one very long line:
var parent=inddObject.typefiSettings.element.anchor.pageItem.parent.parent;
if (parent.constructor.name=='Cell'){
alert('Anchor in cell')
}
Like Uwe said, these kinds of questions are better suited for the Typefi Support Portal.