hii
Can anyone please tell me how can i apply xml tag to auto footnote and convert the tag to text?
And then apply conditional text to the tag?
Please help
hii
Can anyone please tell me how can i apply xml tag to auto footnote and convert the tag to text?
And then apply conditional text to the tag?
Please help
Hi everyone,
My situation is as follows :
I've got multiple documents to make changes to, and I can't have my script to work out on all those open documents.
I'm getting an error :
My script is working on one file, only one, and then stops with this error.
What I'm trying to do :
I would like to move all my texts to a certain layer, that is created by the script, and move all my pictures to another layer, also created by the script. (the graphics must be only graphics, not rectangles with a fillColor, but rectangles with graphics inside of them.)
I'm trying to make this possible on every opened documents.
I also would like to get rid of all other layers, except the two I'm creating with the script.
Why am I doing this ?
Well, I've got documents with images and texts, but also some rectangles filled with colors.
I'm trying to get rid of these rectangles, but I didn't find any way to get rid of rectangles without getting rid of rectangles that have images inside of them...
Here's the code I'm working on :
function moveToLayer(){ var myDoc = app.documents; for (var i = myDoc.length-1; i >= 0; i--) { if(!myDoc[i].layers.itemByName("pictureLayer").isValid){myDoc[i].layers.add({name:"pictureLayer" })}; if(!myDoc[i].layers.itemByName("textLayer").isValid){myDoc[i].layers.add({name:"textLayer"})}; var textLayer = myDoc[i].layers.itemByName("textLayer"); textLayer.locked = false; var pictureLayer = myDoc[i].layers.itemByName("pictureLayer"); pictureLayer.locked = false; myDoc[i].spreads.everyItem().textFrames.everyItem().locked = false; myDoc[i].spreads.everyItem().textFrames.everyItem().itemLayer = textLayer; var myPageItems = myDoc[i].pageItems; for(var i=0; i<myPageItems.length; i++){ if(myPageItems[i].allGraphics.length==1){ myPageItems[i].locked = false; myPageItems[i].itemLayer = pictureLayer; } } } }
I've been searching all over the forum, gathering some pieces of code but now I'm stuck, and begging for your help !
Could someone please explain to me what's going on and what's wrong, and/or could get this script to work as it should ?
Thanks everyone !
Hi,
I'm using InDesign 2014 and I'm creating a web-based app with a document size of iPhone. I export using in5 to HTML. I have a home page with buttons and once you click on one of those buttons at the top of the screen I have a Menu button that if triggered, will display a drop down menu. I am using Scale for the Liquid Layout because I want to be able to have the same layout no matter what device I am using.
The web-app looks great on the browser when it's on the iPhone. However, when I open the web-app on a larger device (tablet, computer) the buttons are much much larger. The image of the button is the correct size, but if one was to click to the right of the image (button) the button would still be activated and go to that page. I am trying to make the button only activate when it's inside of the image and button frame.
When I look at the CSS of the export, I see that the buttons for the drop down menu have a width of 47%. Which is the size of the button (and image) on an iPhone. On larger devices the image of the button is only 10% of the screen, but the button activates when you click half across the page, because the button is 47%. When I change the width of the item, it solves the problem, however, there are now spaces in between the drop down buttons.
Does anyone know how to fix this?
So I have to make contact sheets at work often and I'm trying to make a script that will replace an image with a specific one.
I have gotten this script to do it, but i want it to do it on the page that is currently active, not just Page 1 of the file.
Here is my code:
!
tell application "Adobe InDesign CC 2014"
tell active document
set myPage to active page
relink link "Logo.png" to alias "F3-PLA:03_jobs:ABCCABLE.1127777:ASSETS:Templates:Logos_CS:XD:Logo.png"
try
update link "Logo.png" --sometimes the new link comes up modified. I don't know why.
end try
end tell
end tell
!
Hi there,
I've written some ApplesScripts for Indesign that act on all links, missing links and/or selected links, but what if I wanted to perform an action on a link that is only selected in the links palette?
Is it possible for AppleScript to know which link is selected in the Indesign links palette?
Regards,
David
I'm using InDesign 2014 and I'm creating a web-based app for the iPhone. I have the liquid layout set for Scale. That way, no matter what device you view the app on, it has the same layout.
However, when I view the app on a larger device than the iPhone, all of the buttons are stretched out. By this I mean, on an iPad, the image of the button is only about 1/10th of the screen, but you can 'click' and activate the button outside of the button's image. The reason for this is because on the iPhone, the size of the button's image and the button are about 47% of the screen. Below is a screen shot of the problem on a laptop browser. The blue rectangle is where you can activate the button. However, I only want the button to activate on the button's image.
Does anyone know how to fix this?
Hello Folks,
Here's the situation. We are changing our organizations file structure in a dramatic way. We are removing mapped drives, eg. H:\, and replacing them with shortcuts that will reside in their Windows Explorer that link to \\fs\marketing for example.
We have hundreds, if not thousands, of InDesign files across our organization that are probably not properly packaged when they were done with them. Is there a way to either update the links all at once using a script or being able to run a script when the user opens the InDesign file to map to the new location. It won't be a dramatic change, it'll be something simple like:
H:\DEPT\marketing\project\image.jpg will change to \\fs1\marketing\project\image.jpg
I'm not an InDesign user, just the IT person in charge of getting ready for this change which is why I'm asking here. The link above is only an example of the link, I don't know what the actual links would be. I found a few scripts on here for changing links, but I don't think they are designed to perform a change like this.
We are a Windows only organization. All end users are running Windows 7 64 bit.
Any help/suggestions/ideas would be greatly helpful and appreciated!
Hi experts,
How to ind delimiter:
app.documents.stories.everyItem().tables.everyItem().cells.everyItem().texts.everyItem().d elimiter = “)”
Change:
app.documents.stories.everyItem().tables.everyItem().cells.everyItem().texts.everyItem().d elimiter = “.”
Could you someone show me how.
thanks Regard
John
I'm trying to wrap my head around how to export every page in a document while keeping the exports grouped with Alternate Layout filename suffixes.
Based on a file built like my screenshot - I'd like to have the exports look like:
2015-08-Filename-SL01.jpg
2015-08-Filename-SL02.jpg
2015-08-Filename-SL03.jpg
2015-08-Filename-BN01.jpg
2015-08-Filename-BN02.jpg
2015-08-Filename-BN03.jpg
2015-08-Filename-SP01.jpg
2015-08-Filename-SP02.jpg
2015-08-Filename-SP03.jpg
A bonus would be to have the year and month appended based on the current date, but I could always batch rename after the fact if that wasn't possible. I've tried splicing together assorted scripts that do different parts of this process but I can't get them to mesh... Thanks for the help in advance!
Hi there, is it possible to define a start folder when using selectDialog ? It seems to start by default from the desktop, but would it be possible to start the search from let's say C:\some folder\some other folder\my indesign documents ?
This way I can save myself quite some clicks :-)
Thanks,
Koen
Hello.
I have a simple JavaScript finding and replacing text in hyperlinks. I was wondering if this can be re-written to just add additional text to each hyperlink in Indesign document.
for example "1234" will add 1234 to the end of each hyperlink. google.com will become google.com1234
thank you very much!
main();
function main(){
var d = app.dialogs.add({name:"Replace Hyperlink URL Values"});
var col1 = d.dialogColumns.add();
var col2 = d.dialogColumns.add();
col1.staticTexts.add({staticLabel:"Find (GREP):"});
col1.staticTexts.add({staticLabel:"Replace:"});
var find = col2.textEditboxes.add({minWidth:100});
var change = col2.textEditboxes.add({minWidth:100});
var result = d.show();
if(!result){
d.destroy();
return;
}
var grepForFind = RegExp(find.editContents,"g");
var grepForReplace = change.editContents;
d.destroy();
var dests = app.documents[0].hyperlinkURLDestinations.everyItem().getElements();
for(var i=0;i<dests.length;i++){
dests[i].destinationURL = dests[i].destinationURL.replace(grepForFind,grepForReplace);
}
}
Hi experts,
How to change cells properties.
how to make the script as below working.
Could someone show me how
Regard
John
var
doc = app.documents,
myStories = doc.story.everyItem().getElements(),
cStory, cText, myTables, cTable;
while (cStory = myStories.pop() ) {
cText = cStory.texts[0];
if (!cText.isValid) continue;
cText.fillColor = "Black";
myTables = cText.tables.everyItem().getElements();
while (cTable = myTables.pop() ) {
if (!cTable.isValid) continue;
cTable.cells.everyItem().texts.everyItem().tabStops[0].alignmentCharacter = ".";
cTable.cells.everyItem().texts.everyItem().fillColor = "Black";
cTable.cells.everyItem().fillColor = "Paper";
cTable.cells.everyItem().leftEdgeStrokeColor = "Paper";
cTable.cells.everyItem().rightEdgeStrokeColor = "Paper";
cTable.cells.everyItem().topEdgeStrokeColor = "Paper";
cTable.cells.everyItem().bottomEdgeStrokeColor = "Paper";
}
}
hi,
i'm trying to balance the each page paragraph lines end at the same line at the bottom of the each page..
so i removed the unwanted space, line breaks in the document..
eventhough its not ending at the same line at the bottom of the page..
Is there any script form searching XML tags in InDesign CS4 documents.
Hi every,
Has anyone experience with StringA.localeCompare(StringB) method?
Does it need any library or preferences to work?
Jarek
i want to add caption for all the images in indesign document..
this is my code .. im getting error like ,
invalid parameter.
capset ();
function capset()
{
var doc = app.activeDocument;
var myPicture = doc.allGraphics;
var gb,i, myCaption;
while(pic = myPicture.pop() )
{
gb= pic.geometricBounds;
// add a frame to to picture's parent, which is a Page
myCaption = pic.parent.textFrames.add ();
// set position and size of the caption
myCaption.geometricBounds = [gb[2], gb[1], gb[2]+3, gb[3]];
// add placeholder contents
myCaption.contents = "Caption";
pic.parent.groups.add ([pic, myCaption]);
}
}
Hi,
I’m building up the script that Jongware wrote in his post here http://indesignsecrets.com/tackling-tables-through-scripting.php– I’m trying to create a variable in which I can add a number of different bits of text, in this instance it’s different UK locations i.e. ‘London’, ‘South East’, ‘Scotland’ etc. I just need the script to apply the Cell Style – ‘District Cell’ – to any cell that contains any of the text in the variable. Below is the script, if anyone can help I’d be thankful.
function checkWhichTable() { // ensure the user made a selection if (app.selection.length != 1) return null; var currentTable = app.selection[0]; if (currentTable.hasOwnProperty("baseline")) { currentTable = app.selection[0].parent; } while (currentTable instanceof Cell || currentTable instanceof Row || currentTable instanceof Column) currentTable = currentTable.parent; if (!(currentTable instanceof Table)) { // No table selected return null; } return currentTable; } app.doScript(checkUserSelection, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, "Process Table"); function checkUserSelection () { var a_table = checkWhichTable(); if (a_table == null) { if (confirm("No table selected. Do you want to process *all* tables?") == false) return; allTables = app.activeDocument.stories.everyItem().tables.everyItem().getElements(); for (aTable=0; aTable<allTables.length; aTable++) { processTable (allTables[aTable]); } } else { processTable (a_table); } } function processTable(table) { // do something here! //Find Text in Cell and apply Cell Style var textInCell=['London', 'Scotland', 'South West']; for (i=0; i<table.cells.length; i++) { if (table.cells[i].texts[0].contents==textInCell) table.cells[i].appliedCellStyle = "District Cell"; } }
Hi,
I'm a complete newbie to Applescript but have spent a while searching the internet trying to cobble together a script that, when saved as an application and opened on launching inDesign, will automatically save the document I'm working on to a specific folder every few minutes. This is what I have so far, but I'm not sure it's having the desired effect (just running the script from the editor isn't producing any saves of the file I have open):
repeat
delay 60
tellapplication "Adobe InDesign CS6" tosavefrontdocumentto "path_goes_here"
endrepeat
Can anyone help me troubleshoot this?
Thanks
Hi All,
I want to check the 1day before processed files, (e.g., the user run the tool time and check 24hrs back).
I tried the the below JS code, Please check and guide me.
var myFolder = File("~/Desktop"); var myFiles = (myFolder.getFiles("*.eps")); for(i=0; i<myFiles.length; i++){ var myFile = myFiles[i]; var myFileDate = myFile.modified; var myCurDate = new Date(); alert(DateCheck(myFileDate, myCurDate, myFile)); }//for loop function DateCheck(DtVal1, DtVal2){ var DtDiff; Date1 = new Date(DtVal1); Date2 = new Date(DtVal2); DaysDiff = Math.floor((Date1.getTime() - Date2.getTime())/(1000*60*60*24)); if(DtDiff < 0){ alert(myFile) return true; } else return false; }
Thanks in advance.
Hi
I’m trying to add a section to my table formatting script that will find a cell with the word ‘Budget’ (but this may be written as ‘Budget:’ or ‘Budget: (E)’ – but without the speech marks) and apply the Cell Style – SponsorCells – to all the cells on the whole row. I’ve currently got this going on, but it isn’t working:
function checkWhichTable() { // ensure the user made a selection if (app.selection.length != 1) return null; var currentTable = app.selection[0]; if (currentTable.hasOwnProperty("baseline")) { currentTable = app.selection[0].parent; } while (currentTable instanceof Cell || currentTable instanceof Row || currentTable instanceof Column) currentTable = currentTable.parent; if (!(currentTable instanceof Table)) { // No table selected return null; } return currentTable; } app.doScript(checkUserSelection, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, "Process Table"); function checkUserSelection () { var a_table = checkWhichTable(); if (a_table == null) { if (confirm("No table selected. Do you want to process *all* tables?") == false) return; allTables = app.activeDocument.stories.everyItem().tables.everyItem().getElements(); for (aTable=0; aTable<allTables.length; aTable++) { processTable (allTables[aTable]); } } else { processTable (a_table); } } function processTable(table) { // do something here! //Set 1st Row Height table.rows[0].height = "30mm"; //Find Text in Cell and apply Cell Style to Row var myCellText=['Budget', 'Budget:', 'Budget: (E)']; var myRegEx = new RegExp("^("+myCellText.join("|")+")$"); for (i=0; i<table.cells.length; i++) { if (table.cells[i].texts[0].contents.match(myRegEx)) table.cell[i].appliedCellStyle = "SponsorCells"; } //end - do something here! }
i can get the script to apply the 'SponsorCells' cell style to the individual cells that contain the word 'Budget' etc. but I need ever cell on that row to have the cell style applied. I've tried re-writing line 56 which applies the style to a cell, but i can't seem to make it work. Any help would be great.
Separate to this issue, i'd like to have a line of code similar to line 46, that defines the 1st rows height, but I'd like it to say 'If a cell has 'Cell Style A' applied then set height to '10mm'. If someone could through this in as a bonus help, things would be double great.
Thanks in advance !