Hi all,
An idea? Thanks for your comments!
Hi all,
An idea? Thanks for your comments!
Hello,
we have a problem with the indesign smart textreflow.
We are trying to fill different InDesign templates by a script and because we don't know how many pages the result will have, we are using smart textreflow to add additional pages automatically as needed.
If we open the document visible for the user and fill it with data, everything works as expected.
The problem is, if we open the the document invisible/not visible (or InDesign is minimized while filling) the smart textreflow doesn't add the needed pages and the content will overflow.
doc = gApp.Open(sNewPath, true); // works fine
doc = gApp.Open(sNewPath, false); // our problematic case
While the example template is rather easy to fill we have many different templates that work completely different (sry can't show these), so we don't really want to add pages "manually via script".
So if we open the example template and fill it with data the resulting .pdf will have max 2 pages and the remaining data will be cut off by an overflow.
Because of the higher speed when invisible we would prefer to run this script without the document to be visible but are forced to display it at the moment.
Does anyone have an idea how to solve the problem so we can use smart textreflow with the document beeing invisible?
Regards
A desperate programmer
Hi
I have a script for InDesign to create a Vizier on a vertical line and horizontal line. Which works perfectly on horizontal line but it rotate and moves the object from its current position while creating a Vizier on vertical line. Can any one help to make it stay on its original position.
Here is the script that I have. You can find the error image as well at the bottom. Thanks a lot for your help in advance.
var half = 0.07;
var vee = 0.0416666667;
var obj = app.selection[0];
if(app.selection.length == 0){ alert("Error: No line is selected; please select a single line to Vizier."); exit(0);}
if(obj.constructor.name != "GraphicLine"){alert("Error: A line was not selected; please select a line to Vizier."); exit(0);}
var bounds = obj.geometricBounds;
var width = bounds[3]-bounds[1];
var height = bounds[2]-bounds[0];
var midpoint_h = bounds[2] - (height / 2.0);
var top = midpoint_h - half;
var bottom = midpoint_h + half;
var y1 = bounds[2];
var midpoint = bounds[1] + (width / 2.0);
var left = midpoint - half;
var right = midpoint + half;
var y = bounds[0];
if(app.selection.length != 1){ alert("Error: More than one object was selected; please select a single line to Vizier."); exit(0);}
if(height != 0.0)
{
obj.paths.item(0).entirePath = [[bounds[0], y1], [top, y1], [midpoint_h, y1+vee], [bottom, y1], [bounds[2], y1]];
app.layoutWindows[0].transformReferencePoint = AnchorPoint.TOP_LEFT_ANCHOR;
obj.rotationAngle = 90;
} else if(width != 0.0) {
obj.paths[0].entirePath = [[bounds[1], y], [left, y], [midpoint, y+vee], [right, y], [bounds[3], y]];
}else{alert("Error: the line is not horizontal.\nThis script only works on perfectly horizontal lines.");exit(0);}
The document has more numbered paragraph styles, but this conversion is necessary in just one style; and selecting the whole document will alter other styles that should preserve the automatic numbering.
Thanks.
I'm using the excellent MultiPageImporter2.5-CS5.jsx script from Zanelli to import a PDF file in an Indesign document. The (Java)script starts with a popup and asks for the starting page to place the imported PDF.
How can I pass a variable to this script from Applescript with the page number where to place the PDF file and continue without having to manually fill this out in the MultiPageImporter2.5-CS5.jsx popup ?
Here's the applescript that gets the page numbers into variable thismanypages, how to pass this on to MultiPageImporter2.5-CS5.jsx in Indesign in the next step?
tell application "Adobe InDesign CS5.5"
tell document 1
set thismanypages to count pages
end tell
end tell
set aScriptPath to "Users:admin:Library:Preferences:Adobe InDesign:Version 7.5:en_US:Scripts:Scripts Panel:MultiPageImporter2.5-CS5.jsx"
tell application "Adobe InDesign CS5.5"
do script alias aScriptPath language javascript
end tell
Hi all,
just read the release notes for the all new InDesign CC-2015 and came accross the following known issue:
InDesign Help | InDesign CC 2015 Release Notes
InDesign crashes if a user inserts a button in a story programmatically (via scripting).
And indeed, a simple ExtendScript line of code like this will crash InDesign:
app.documents[0].textFrames[0].texts[0].insertionPoints[-1].buttons.add();
Fortunatelly there is a workaround!
Just create your button on the page and then make it an anchored object:
var myButton = app.documents[0].buttons.add(); myButton.anchoredObjectSettings.insertAnchoredObject( app.documents[0].textFrames[0].texts[0].insertionPoints[-1] , AnchorPosition.INLINE_POSITION);
Hope that helps until this issue is resolved.
Also see:
Adobe InDesign CS6 (8.0) Object Model JS: Button
Adobe InDesign CS6 (8.0) Object Model JS: AnchoredObjectSetting
Uwe
Hi,
I set a scriptUI interface.
I have two buttons :
- one has to add a carriage return on the edittext field
- one has to add tab.
I am using textselection property of the edittext object.
On Mac it works very fine.
On Windows, it just go crazy. Sometimes, it just ignores the click, other times, it adds the element unexpectingly.
ie tab or carriage return are placed everywhere but where I want it.
What do I do wrong ?
TIA Loic
When transferring my dissertation from MS Word to InDesign, I want the footnotes to appear alongside the text, rather than below at the bottom of the page. I asked this question in the general InDesign forum and one person replied that: "I think it could be scripted. You should ask in the scripting forum if someone could help you to get a script which would convert footnotes to margin notes. Maybe that some script exists which would put footnotes into anchored frames. Those anchored frames could be moved to side notes via adjusting the object style. I think I have seen something like this."
I have zero experience scripting, so providing any help in what the (potentially existing) script is as well as how to utilize it would be incredibly helpful!
Hi All,
I apologize for the long title, but I am going to be working on a migration from one online storefront to another brand, EFI Digital StoreFront. I will also be working with DirectSmile to help with the variable data information. My question is, is it possible to create a script using JavaScript that would allow certain pages to be turned on/off when outputted depending on the data?
To give you an example, I have one magazine layout but the last page has to alter between a female advertisement and a male advertisement, depending on if the customer is male or female in the linked database. It would then output the magazine, with the correct advertisement on the last page, and continue until the database is complete.
Also, if anyone has any experience working with EFI Digital Storefront & DirectSmile, feel free to give me some advice.
Thank You!
Hi everyone!
I need help for creating a script (or modifying existing script) that should replace every Cyrillic character from an old ASCII font with the same Cyrillic character but from new Unicode font.
For example: Capital letter 'A' GID=107 from old font (Lazurski) should be replaced with 'A' GID=630 from new one (Myriad Pro).
I can do this by using Indesign Find/Change - Glyphs, but this will take me too much time.
So, I need a scrip for this job.
My first attempt was to use the FindChangeByList script by modifying the FindChangelist.txt document, but without success.
Here is what I've used until now:
1) glyph {glyphID:107, appliedFont:"Lazurski"} {glyphID:630, appliedFont:"Myriad Pro"} {caseSensitive:false, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}
2) glyph {findWhat:"u00C0", appliedFont:"Lazurski", fontStyle:"Bold"} {changeTo:"0410", appliedFont:"Myriad Pro", fontStyle:"Bold"} {caseSensitive:false, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find ASCII A replace with Unicode A.
Both lines didn't change anything. What is wrong?
Any help is welcome!
Regards,
Veselin
P.S. Indesign CS5
Hello,
I'm running into a problem with a script that updates the text in a textframe. If the text that I'm putting into the new textframe causes an overflow, all of the overflow text seems to be jumbled and formatted differently. I can test/prove this by running my script on a small text frame, then when its complete, I can go to Indesign and expand the text frame to see the bad text. However if I leave the text frame expanded and run my script again, it works perfectly. Is there a setting I could be missing, or has anyone experience this before that would cause overflown text to become jumbled?
Thanks in advance for any help/advice/suggestions!
-Lloyd
I read the excellent article in Nov 08 issue of InDesign Magazine on using FindChangeByList. I am publishing stories on the card game Bridge which uses symbols for Hearts, Spades, Diamonds, and Clubs. I would like to use a script that replaces easily-typed characters for the suit symbols and makes the Hearts and Diamonds red. I have managed to write a script that replaces the symbols, but cannot find a way to make some of them red. Or better yet, applies a Character Style. Below is my script. Can anyone help me change the Hearts and Diamonds to red?
glyph | {glyphID:4,appliedFont:"Times",fontStyle:"Regular"} | {glyphID:386,appliedFont:"Apple Symbols",fontStyle:"Regular"} | {includeFootnotes:false, includeMasterPages:false, includeHiddenLayers:false} | Find all exclamation marks and replace with clubs. |
glyph | {glyphID:7,appliedFont:"Times",fontStyle:"Regular"} | {glyphID:383,appliedFont:"Apple Symbols",fontStyle:"Regular"} | {includeFootnotes:false, includeMasterPages:false, includeHiddenLayers:false} | Find all exclamation marks and replace with clubs. |
glyph | {glyphID:6,appliedFont:"Times",fontStyle:"Regular"} | {glyphID:388,appliedFont:"Apple Symbols",fontStyle:"Regular",appliedCharacterStyle:"Red Suits"} | {includeFootnotes:false, includeMasterPages:false, includeHiddenLayers:false} | Find all pound signs and replace with hearts. |
glyph | {glyphID:35,appliedFont:"Times",fontStyle:"Regular"} | {glyphID:389,appliedFont:"Apple Symbols",fontStyle:"Regular",appliedCharacterStyle:"Red Suits"} | {includeFootnotes:false, includeMasterPages:false, includeHiddenLayers:false} | Find all at marks and replace with diamonds. |
Hi There,
Hoping that there would be any solution for it, I'm pushing my question to your way - I have a InDesign file with a spread that has two pages, each page has it's own slug with page related information now what I need to get page object pertaining to that slug.
As we all know that parentPage property returns null incase of pageItem is outside the page trim area.
I tried something like this but it does not work here.
function getPageNumber(curPageItem) { var doc =app.activeDocument; for(pageIndex=0; pageIndex < doc.pages.length; pageIndex++) { var curDocPage =doc.pages[pageIndex], pageBounds = curDocPage.bounds, pageWidth = pageBounds[3] - pageBounds[1]; if(curPageItem.parentPage == null) { var pageItemBounds = curPageItem.geometricBounds, itemX0Position = pageItemBounds[1]; if((curPageItem.extractLabel(scriptLabels.LSLUG) == scriptLabels.LSLUG && itemX0Position < pageWidth) || (curPageItem.extractLabel(scriptLabels.RSLUG) == scriptLabels.RSLUG && itemX0Position > pageWidth)) { return var pgNum = curPageItem.contents; } } } }
Thanks in advance
Mac
Hi,
When I run the following using cscript on Windows 7 it gives the above error.
CreateObject("InDesign.Application.CC").DoScript jsx
This happens only when I try to launch InDesign CC 32 bit application. With Adobe InDesign CC 64 bit applcation it works fine.
Any input is much appreciated.
Thanks And Best Regards,
Dinesh.
Hi all.
I have in my workflow a need to "load paragraph styles and characters" from a file to a dozen others - I would love to have a script that couls enable a "load to all open documents".
Can any of you do that magic? thanks
Rui
Hi,
I am very new in using XSLT to format XML file.
I would like to know if there is a tool to generate an xslt/fo file from an xml?
Thank you,
Hi Scripters. I am asking this here because I know there are some coding studs that hang out here. I posted a request for help on the FrameMaker ExtendScript forum, but the traffic there is pretty light. Here is the gist of what I am doing. I am recursively processing an XML document. I am keeping track of what "level" I am in in the XML structure. But I also want to keep track of the current level so I can see when the level changes, and in what direction. I can keep track of the level, but I am having a hard time keeping track of the previous level so I can correctly detect a change. I posted some sample code and an example XML file here.
I hope it is OK to cross-post like this. Thanks in advance for any help or pointers. -Rick