Forum Replies Created
-
AuthorPosts
-
March 21, 2018 at 7:59 am in reply to: Changing a color if one of the CMYK values is less than 3% #102543
Colin Flashman
MemberI think this script might have an answer in your general direction:
https://indesign.hilfdirselbst.ch/farbe/farben-reduzieren-duplikate-entfernen.html
Colin Flashman
MemberI have two for you. I wrote one, and the other is from Luis Corullon:
https://colecandoo.com/downloads/ (look for Import all styles, colours and master pages from a selected file)
https://lf.corullon.com.br/scripts_id_lfc/index_enus.html (byLFC_import what you want:)Colin Flashman
MemberThere is a script that ships with Adobe InDesign called SelectObjects.jsx – run that script and it will display a user interface asking what you want to select. Uncheck what you don’t want to select and run the script, and then all specific items (on a spread only) will be selected.
If you don’t want to uncheck boxes all the time, open the script in a text editor such as text wrangler and look for the following lines of code:
var myRectanglesCheckbox = checkboxControls.add({staticLabel:”&Rectangles”, checkedState:true});
var myEllipsesCheckbox = checkboxControls.add({staticLabel:”&Ellipses”, checkedState:true});
var myPolygonsCheckbox = checkboxControls.add({staticLabel:”&Polygons”, checkedState:true});
var myGraphicLinesCheckbox = checkboxControls.add({staticLabel:”&Graphic Lines”, checkedState:true});
var myTextFramesCheckbox = checkboxControls.add({staticLabel:”&Text Frames”, checkedState:true});
var myGroupsCheckbox = checkboxControls.add({staticLabel:”G&roups”, checkedState:true});
var myImagesCheckbox = checkboxControls.add({staticLabel:”&Images”, checkedState:true});
var myPDFsCheckbox = checkboxControls.add({staticLabel:”P&DFs”, checkedState:true});
var myEPSsCheckbox = checkboxControls.add({staticLabel:”EP&Ss”, checkedState:true});to make any checkbox unchecked, change the checkedState:true to checkedState:false
Colin Flashman
Member@Masood
I’m sorry if my answers weren’t what you were expecting or wanted, but I believed that this forum operated in a similar function to the InDesign Scripting forum on the Adobe forums – that is, scripters posting to other scripters wanting help with specifics in scripts or bug detection. If I’ve misunderstood the purpose of this forum then that’s on me.I also feel that there is a misunderstanding about me trying to sell my services – I’m not doing that. Again, if that’s how it came across in my post then I apologise, but I actually feel identically to you in that using forums to advertise one’s services isn’t how one should conduct business and should NOT be done… whether this forum or any social media. My comment was simply meant to highlight that writing a complete script is usually a commercial service, and not something I’d expect to find in the public domain unless the author felt like doing so out of complete benevolence.
It’s worth stating that I regularly contribute free scripts in the public domain via my own website. In fact, my website has no scripts available for purchase (at the time of writing this post) and the only money that changes hands via my site is if people choose to donate or not, and that option is entirely up to the user. Any post from me (or article, script, video etc) whether on this site or another – is completely done in my own spare time and not during my working hours as a Prepress Operator. For me, this is my form of serving my community – that is, other InDesign users.
Colin Flashman
MemberOK, that’s not what’s happening here when I test on my Mac, the script works as intended.
My suggestion would be to bring in the desired styles first from a document that contains the styles you need, and then run the code you have. There is a script that will import all styles, master pages etc that might help – go to https://lf.corullon.com.br/scripts_id_lfc/index_enus.html and look for “byLFC_import what you want”
While my earlier post does comment about the length of the code you have, it will still work and shouldn’t present any issues.
March 12, 2018 at 12:31 am in reply to: JS to delete old style and replacing it wih new one. #102329Colin Flashman
MemberAre you able to be a little more specific (i.e. when you say “but didn’t got any success” do you mean that nothing happened, or an error was produced?)
It’s working for me, but both styles have to be present in the current document. That is, if the desired style isn’t in the document, it won’t work.
The script is rather verbose, I’d probably use a for-loop rather than copy the code out twenty times, but either way it should work.
Colin Flashman
MemberAs my original post says, “Please understand that writing complete scripts is the lifeblood of javascripters, so asking for a complete script is usually a task that a scripter would be paid for”.
That said, I’m not writing the complete script for you, but instead telling you where the answer lies – in Jongware’s post in InDesignsecrets. Your original post does say “any help would be appreciated”. Jongware’s article will certainly answer your question as well as future table issues.
I did give you the first parts of the script that are from the article as not only is it in the public domain, it’s on indesignsecrets. Those portions are: to differentiate between every table and the table the cursor is in; and how to apply a table style to the selected table.
Colin Flashman
Memberthird part – having so much trouble with the forum tonight!
I’ll get you started on the next portion of the script (the part two) but parts 2.1 and 2.2 can be answered by reading Jongware’s article:
function processTable(table)
{
table.appliedTableStyle = “myTableStyle”;}
Colin Flashman
Member(second part of my original answer – forums giving me grief):
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); } }Colin Flashman
MemberDo you have a script at the moment that you are having difficulty with and you can share with us, or would you like a complete script written? Please understand that writing complete scripts is the lifeblood of javascripters, so asking for a complete script is usually a task that a scripter would be paid for, unless posters reading this request feel benevolent or are after a challenge.
Jongware wrote a great piece back in the day about tackling tables through scripting: https://creativepro.com/tackling-tables-through-scripting.php
In his article, it highlights how to select a table that the cursor is in (the first part of your question):
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;
}Colin Flashman
MemberNo, Data Merge won’t work from an indb. The file would need to be one complete INDD file.
I’ve written a script that’s available for free on my website that will allow you to export the individual records to their recordnames – have a look at the script in action:
Data Merge from InDesign to unique filenames – now a reality
Colin Flashman
Member@Roel & Bhadresh:
This script may be the answer, however the filename will need @ signs before and after it:
https://kasyan.ho.com.ua/indesign/image/place_images.htmlColin Flashman
MemberTry this script from Roland Dreger: https://www.rolanddreger.net/de/276/fotobuch-mit-adobe-indesign/# – works with pdfs
Colin Flashman
MemberColin Flashman
MemberThere are also some good books that I have as resources:
Automating Adobe InDesign CS4 with Extendscript by Shirley W Hopkins (ISBN 9781448637591)
InDesign CS5 Automation Using XML & Javascript by Grant Gamble (ISBN 9781460915387)
InDesign automatisieren: Keine Angst vor Skripting, GREP & Co. (in German, ISBN 9783864902352) -
AuthorPosts