Quantcast
Channel: Adobe Community: Message List - InDesign Scripting
Viewing all 37788 articles
Browse latest View live

'Object Invalid' when trying to remove() a pageItem

$
0
0

Hi,

 

I'm successfully getting a reference to a non-threaded text frame that I want to delete, but calling .remove() on it results in error 45 'Object is invalid'

 

Seems like this code should work? But it doesn't :-(

 

 

 

varworkbooklegal = workbook.pages.item(1).pageItems.item('govcapost-legal');

 


   // alert(workbooklegal) // InDesign alert: [Object PageItem]


   workbooklegal.remove();


Re: Is there an InDesign plug in or ExtendScript for the functions described below?

$
0
0

Can there be more than one Master Text Frame on a Master page? The Master Text Frame is dictated in the Margins and Columns command box.  I want to add another text box to the master page that will let text flow in these particular additional master text boxes through all the pages of the document.

MultipleMasterTextBoxes.jpg

Re: 'Object Invalid' when trying to remove() a pageItem

$
0
0

After some research, I discovered that the syntax .items('scriptlabel') is not supported for newer versions of InDesign. I iterated through the pageItems collection of the page, testing for .label == 'scriptlabel' and this worked to get a valid object for scripting commands.

Re: Is there an InDesign plug in or ExtendScript for the functions described below?

$
0
0

Can there be more than one Master Text Frame on a Master page?

Sure, there can be any number of text frames on a master page (there can only be one Primary Text Frame). Both my script examples use two master frames on the spread. For flowing text you would need to thread the two frames:

 

Screen Shot 6.png

Re: Outlines Entire Text All Page Indesign

$
0
0

This is GENIUS and SUCH a huge time saver, THANK YOU!!!!!
Better yet, I can still edit the document!!! <3

Re: 'Object Invalid' when trying to remove() a pageItem

Re: Outlines Entire Text All Page Indesign

$
0
0

Hi together,

no need to outline text in InDesign, I think, if it can be done in an exported PDF:

 

Acrobat Pro DC

Print Production

Preflight > Acrobat Pro DC 2015 Profiles

 

Select single fix ups

Document > Convert fonts to outlines

 

ConvertFontsToOutlines.PNG

 

Regards,
Uwe

 

The Adobe Forums are transitioning to a new community experience soon.

New threads and replies posts to the forums between August 22nd and September 9th will likely be lost, but we’re still here to help during that time.

Re: With CS5, some things have changed

$
0
0

Hi,

start your ExtendScript Toolkit app (ESTK) and look under "Help".

 

Don't know the exact paths under Windows, but for Mac OSX you'll find some PDFs about scripting CS5 here:

 

CS5 (version 7)

/Applications/Utilities/Adobe Utilities - CS5/ExtendScript Toolkit CS5/

ExtendScript Toolkit ReadMe.pdf

 

/Applications/Utilities/Adobe Utilities - CS5/ExtendScript Toolkit CS5/SDK/English/

Adobe Intro To Scripting.pdf

 

/Applications/Utilities/Adobe Utilities - CS5/ExtendScript Toolkit CS5/SDK/

JavaScript Tools Guide.pdf

 

And if you mean scripting of InDesign version 5 (CS3) your ExtendScript Toolkit 2 should lead the way.

 

If you do not have the ESTK available see here:

ExtendScript Toolkit Archives | Adobe Developer Connection

 

EDIT August 27, 2019

The link above is still working, but the links on the landing page will not provide you with valid download links for the ESTK.

 

Indispensable resources of DOM documentation compiled by Jongware:

Indesign JavaScript Help

 

Regards,
Uwe


rotating text box

$
0
0

i'm trying to do this with script:

108000.gif

i also write this two lines:

app.selection[0].rotationAngle = 25;
app.selection[0].absoluteRotationAngle = -25;

but it doesn't help.

would you give me a clue?

thanks a bunch.

Re: rotating text box

$
0
0

Hi,

think, you have to do that differently.

 

One simplistic solution for a rectangular shaped text frame could be this:

 

var rect = app.selection[0];
var pathPointPositions = rect.paths[0].pathPoints.everyItem().anchor ;

rect.rotationAngle = 25 ;

var pathPointsArray = rect.paths[0].pathPoints.everyItem().getElements();

for( var n=0; n<pathPointsArray.length; n++ )
{
pathPointsArray[n].anchor = pathPointPositions[n];
}

 

Regards,
Uwe

 

 

The Adobe Forums are transitioning to a new community experience soon.

New threads and replies posts to the forums between August 22nd and September 9th will likely be lost,

but we’re still here to help during that time.

Layout Adjustment property ---- InDesign CC Server

$
0
0

I am experiencing problem when we are trying to enable the Layout Adjustment property through InDesign CC Server_Scripting.

 

app.documents[0].layoutAdjustmentPreferences.enableLayoutAdjustment=true;

 

Could you please if anybody helps us to solve this problem?

Re: Layout Adjustment property ---- InDesign CC Server

Re: Layout Adjustment property ---- InDesign CC Server

$
0
0

How to set transformReferencePoint

 

//   app.layoutWindows[0].transformReferencePoint = AnchorPoint.TOP_LEFT_ANCHOR;

Re: Finding Unassigned Glyphs

$
0
0

I am working with a Word text file that originally used a font called First Nations. I changed the Word file all to Minion Pro and I can see all of the diacritics and special characters used in the Word file.

Screen Shot 2019-08-27 at 10.28.16 AM.jpg

BUT, when I import the file into InDesign, I get the dreaded X for the missing glyphs. They really are not missing as Minion Pro has them, but for some reason they are not getting imported properly. I would have to go and change each one individually which would take too long plus allow for mistakes.

 

Any suggestions on what to do?

 

Screen Shot 2019-08-27 at 10.31.30 AM.jpg

Re: Layout Adjustment property ---- InDesign CC Server

$
0
0

Hi sreekarthikeyank ,

what's the exact version of your InDesign Server?

 

FWIW: The old feature "Layout Adjustment" ( CS5 to CC 2018 ) is dead with InDesign CC 2019.

 

The new feature "Adjust Layout" that has substituted "Layout Adjustment" is totally different.

https://www.indesignjs.de/extendscriptAPI/indesign13/#LayoutAdjustmentPreference.html vs.

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#AdjustLayoutPreference.html

 

Regards,
Uwe

 

The Adobe Forums are transitioning to a new community experience soon.

New threads and replies posts to the forums between August 22nd and September 9th will likely be lost,

but we’re still here to help during that time.


Re: Layout Adjustment property ---- InDesign CC Server

Adding 1 pt. black border with a script

$
0
0

Hi guys,

 

I've recently found a script which will help my workflow tremendously if i can adjust it properly. I make obituaries for a living, which need a simple 1 pt black border around the whole page. I would like to have a script which adds this for me.

 

Currently I have this:

 

var myDoc = app.activeDocument;  

myDoc.viewPreferences.rulerOrigin = RulerOrigin.pageOrigin; 

var currentPage = myDoc.layoutWindows[0].activePage; 

var myLayer = app.activeDocument.layers.item("QR"); 

if(!myLayer.isValid) 

        myLayer = app.activeDocument.layers.add ({name: "kader"}); 

    } 

myLayer.layerColor = UIColors.GRASS_GREEN; 

myLayer.move(LocationOptions.AT_BEGINNING);  // üste tasi 

var myFrame = currentPage.rectangles.add ({geometricBounds:[0,0,85,200]}); 

myFrame.contentType = ContentType.GRAPHIC_TYPE; 

myFrame.appliedObjectStyle = krkod; 

myFrame.frameFittingOptions.autoFit = true; 

myFrame.itemLayer = myLayer; 

 

 

But this script doesn't take in account the varying size of the page. It only places it at the top left corner. Is there a way to make it that it will fit neatly around my whole page?
Also, it would be perfect if it would add the black border by it self. Can someone help me with this?

 

Kind regards!

Re: 'Object Invalid' when trying to remove() a pageItem

$
0
0

Hi Ted,

you could switch between the two behaviors, the one from CS4 and before and the one from CS5 and above.

See: Re: With CS5, some things have changed

 

See what Dave Saunders does there with app.scriptPreferences.version .

DOM documentation e.g. here:

https://www.indesignjs.de/extendscriptAPI/indesign14/#ScriptPreference.html

 

WARNING: Before changing anything just read out the default value of version with your version of InDesign.

In line 4 below item("Fred") gathers all script labels that have value "Fred" with all plain, not nested, text frames in the active document. Also e.g. with running InDesign CC 2019. FWIW: InDesign CC 2019 has the default value "14.0" for property version of app.scriptPreferences.

 

var myDoc = app.documents[0];
var defaultVersion = app.scriptPreferences.version;  
app.scriptPreferences.version = "6.0"  
var myTFs = myDoc.textFrames.item("Fred");  
alert(myTFs.toSource());  
app.scriptPreferences.version = defaultVersion;

 

 

Regards,
Uwe

 

The Adobe Forums are transitioning to a new community experience soon.

New threads and replies posts to the forums between August 22nd and September 9th will likely be lost,

but we’re still here to help during that time.

Re: rotating text box

Re: Grep in a text range

$
0
0

Hey, I have a similar issue that was fixed by your comment.

 

Not working:

// text in frame: hi, my name is joe
var myFrame = app.selection[0]
var text = myFrame.parentStory.insertionPoints.itemByRange(myFrame.insertionPoints[0].index,myFrame.insertionPoints[0].index+10).texts[0]
$.writeln(text.contents)
app.findGrepPreferences = null
app.findGrepPreferences.findWhat = 'my'
me = text.findGrep()
$.writeln(me[0].contents)

Working:

 

 

// text in frame: hi, my name is joe

var myFrame = app.selection[0]

var text = myFrame.parentStory.insertionPoints.itemByRange(myFrame.insertionPoints[0].index,myFrame. insertionPoints[0].index+10).getElements()[0]

$.writeln(text.contents)

app.findGrepPreferences = null

app.findGrepPreferences.findWhat = 'my'

me = text.findGrep()

$.writeln(me[0].contents)

 

 

Do you have ideas why texts[0] does not work, while getElements()[0] will? Both get the text successfully, but the grep will not see the stuff in texts[0]..

 

Thanks,

Christopher

Viewing all 37788 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>