With this approach of generating XPath will only find that specific node, even if other elements are available with the same xpath. So if you don't want to find other matching element with the same xpath then this approach can be used. Some people may say this as hardcoding approach. And if counter of element changes within the same parent, then this XPath will not work. Sunil
... View more
Hi @justinn58611098, Currently with this above script same thing is happening as you asked. 1,2,3 are section markers & a, b are page numbers. Sunil
... View more
Hi @mvanhorn_336, To do this, this script will be useful for you: var myDoc = app.documents[0];
var c = 0;
var index = 1;
while(c < myDoc.pages.length){
try{
var sec = myDoc.sections.add(myDoc.pages[c]);
}
catch(e){
var sec = myDoc.pages[c].appliedSection;
}
sec.continueNumbering = false;
sec.pageNumberStart = 1;
sec.sectionPrefix = (index).toString();
//sec.pageNumberStyle = PageNumberStyle.LOWER_LETTERS;
sec.pageNumberStyle = PageNumberStyle.UPPER_LETTERS;
// You can increase +4 to any other number for increasing abcd, if needed upto "F" then count from a-f is 6 digit,
// it becomes "c = c+6;"
c = c+4;
index++;
} Sunil
... View more
If you use xmlRuleProcessor, you will never have to be dependent on gluecode ever. Rule processor will find each & every node in sequential manner.
evaluateXPathExpression is also used for finding node (it won't be able find nodes in sequntial).
... View more
I think this should work for you:
var myDoc = app.documents[0];
for(var i = 0; i < myDoc.pages.length; i++){
myDoc.pages[i].select();
app.doScript(File("Your script file path goes here"))
}
Best
Sunil
... View more
Did you make sure after adding all those qr code your parent stroy frame will not run into overflow?
Try to add few frames extra & link to it so that while inserting QR code main frame should not go into overflow.
Best
Sunil
... View more
You are doing correct to run the script. But your document might have something extra of may be URL might not be matching. Can you share those URL that you are trying to do on?
Or may be if you can share InDesign document.
Sunil
... View more
I have an idea for that you might wanna try.
Instead of finding page number using find method for TOC. If you do some manipulation with TOC style for example just assign a specific character style to page number in TOC. Then generate TOC.
So while generating TOC character style will be applied automatically. So you can find page number of TOC very easily without bothering if it is real number or roman number or whatever.
Best
Sunil
... View more
Try this :
alert (check(536));
//=============================
function check(y){
var number = [41,73,113,147,181,213,255,291,333,365,405,435,467,505,535,567,607,643];
number = number.sort(function(a, b){return a - b;});
if(y < number[number.length-1]){
return true;
}
return false;
}
Best
Sunil
... View more
See VB script,
I have executed JSX script from VBscript targeting a session of InDesign Server,
Same way you also might do it using Shell Script.
Sunil
... View more
As far as windows is concerned, you can do like this with VBscript :
Set myInDesign = CreateObject("InDesignServer.Application")
Set myInDesign = GetObject("configuration_12345")
myJavaScript = "app.doScript(File('C:/Users/sunil/Desktop/test.jsx'));"
myInDesign.DoScript myJavaScript, 1246973031
I am not good with appleScript, so can not say much about that.
Note : "configuartion_12345" here "12345" is port number of session created for InDesign Server.
Best
Sunil
... View more