Back

If your email is not recognized and you believe it should be, please contact us.

Forum Replies Created

Viewing 15 posts - 106 through 120 (of 500 total)
  • Author
    Posts
  • in reply to: Fake Duotone in InDesign #98516
    Masood Ahmad
    Participant

    After a lot of hit and trials, I came up with this:


    //Fake Duotone in InDesign
    //Edited by: Masood Ahmad, 29th September 2017
    //Original Script created by: Ari S. - designerjoe@outlook.com

    app.scriptPreferences.enableRedraw = false;
    app.doScript(main, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, "Image Manipulation Script");

    function main(){
    try{
    var mySelection = app.selection[0];
    var bottomObject = mySelection;
    var topObject = bottomObject.duplicate();
    var midObject = bottomObject.duplicate();
    topObject.transparencySettings.blendingSettings.blendMode = BlendMode.LUMINOSITY;
    midObject.transparencySettings.blendingSettings.blendMode = BlendMode.MULTIPLY;
    bottomObject.transparencySettings.blendingSettings.blendMode = BlendMode.NORMAL;

    // Find Duotone swatch position
    var myDoc = app.activeDocument;
    var mySwatches = myDoc.swatches;
    var swatchesLength = mySwatches.length;
    for (i=0;i<swatchesLength;i++) {
    if (mySwatches[i].name == "duotone" || mySwatches[i].name == "Duotone") {
    var duotoneSwatch = mySwatches[i];
    bottomObject.fillColor = duotoneSwatch;
    }
    }

    // Check if Duotone swatch is defined
    if (duotoneSwatch == undefined) {
    //alert("Please create a Duotone swatch");
    var myColor = myDoc.colors.add();
    myColor.colorValue = [75,5,100,0];
    myColor.name = "Duotone";
    bottomObject.fillColor = myColor;
    }

    try {
    var myGroup = bottomObject.parent.groups.add ([bottomObject, midObject, topObject]);
    app.select(myGroup);
    }
    catch (myError) {
    alert("could not group successfully");
    }
    }
    catch (myError){
    alert("Make sure you selected a graphic frame");
    }
    }

    The scripts works well and duly checks, create and apply the Duotone swatch.

    The only part remaining in the script is to:
    1) Delete the image (content) from the bottomObject i.e. keep the bottom frame but delete its content image.

    Last but not the least, clean-up the script to avoid unnecessary codes.

    Thanks in advance.

    in reply to: Fake Duotone in InDesign #98501
    Masood Ahmad
    Participant

    Sorry, small correction in point # 6.

    6) If “Duotone” colour already exists, then skip the creation of Duotone in point #5 and simply apply the Duotone color to the bottomObject.

    in reply to: Stripping out the initial common numbers #97997
    Masood Ahmad
    Participant

    Hi Mike,

    Both the scripts worked like a charm, but I’ll prefer to use the first one. It will help me to replace and check my content.

    As I said in my initial post, I’ll also try some GREP code. It seems I’m lucky to achieve it. I came up with three Grep Code sequence to run one by one. I wonder I might have to add subsequent codes, if the numbers are too lengthy. However, I’m happy as it is working on the existing text.

    1st Run) GREP Find/Change:
    Find What: (\d\d\d)(\d\d\d), \1
    Change to: $1$2,

    2nd Run) GREP Find/Change:
    Find What: (\d\d\d)(\d\d\d), (\d\d\d), \1
    Change to: $1$2, $3,

    3rd Run) GREP Find/Change:
    Find What: (\d\d\d)(\d\d\d), (\d\d\d), (\d\d\d), (\d\d\d), \1
    Change to: $1$2, $3, $4, $5,

    Thanks Mike for giving me an instant solution. The script is going to help me a lot.

    in reply to: Stripping out the initial common numbers #97969
    Masood Ahmad
    Participant

    Hi Mike, The script is not working. As I requested earlier that I need a way out to feed the source numbers either from a selection or through input message box. Can you please look into this again and help me out with some updated and working code.

    Thanks in advance.

    in reply to: Stripping out the initial common numbers #97949
    Masood Ahmad
    Participant

    Of course I love videos and this one is really good and it could be great if I could see the code :)

    in reply to: Stripping out the initial common numbers #97946
    Masood Ahmad
    Participant

    Hi Mike, thanks for the code and suggestions. It seems interesting and hope it will work as expected. I’m away from my computer right now so I’ll test it on Monday.

    Though I am not a script writer but it looks that you have taken the source numbers as constant values whereas they are not fix. They are of varied length and numbers. So I need a way out to feed the source numbers either from a selection or through input message box.
    Hope I’m able to explain.

    in reply to: Stripping out the initial common numbers #97898
    Masood Ahmad
    Participant

    I came up with this code, but it removes the duplicate initial numbers from the second group only.

    GREP Find/Change:
    Find What: (\d\d\d)(\d\d\d), \1
    Change to: $1$2,

    …I’ll try more

    in reply to: Objects and properties, and methods and parameters #97063
    Masood Ahmad
    Participant

    The ExtendScript Toolkit is all you need. However, if you need more, I would suggest vising this valuable resource:

    https://www.jongware.com/idjshelp.html

    Oooooppps! that’s a lot much :)

    Masood Ahmad
    Participant

    Hi Michael,

    Can you please explain a little more so that a GREP code can be written.

    Secondly, you can easily apply tags using the Find/Change. In the Change Format Settings, click the XML option at the bottom left and then choose the XML Tag to apply to.
    But before the F/C, you need to import the XML Tags in to your document.

    in reply to: InDesign Script to export each selection #97018
    Masood Ahmad
    Participant
    in reply to: Script to rename all Paragraph styles #97017
    Masood Ahmad
    Participant

    @Kai, Let’s say…
    I group all the Paragraph Styles and named the group as “Styles for ABC”, now I want a script that will pop me to input the Group name (to make changes to) and also pop me for the suffix to rename the para styles with that group.

    This is useful, when I want to duplicate the styles and create new ones with minimal changes.

    Hope you have something in your pockets.

    in reply to: Running Multiple Scripts #97015
    Masood Ahmad
    Participant

    @Peter, your script works very well and I use it more often, when I have to export a number of PDFs. Is it possible somehow to batch convert both IDML and PDF in one go. Currently I export PDFs and then IDMLs.

    in reply to: Custom page numbering: Q1, A1, Q2, A2 — How to set up? #96979
    Masood Ahmad
    Participant

    Ahh! How I missed it :(

    in reply to: Problem with Optical Margin Alignment in a list #96978
    Masood Ahmad
    Participant

    Optical Margin Alignment works on text frames not on Actual Text. You have to create separate Text Frames for the List numbers and apply Optical Margin Alignment on it.

    in reply to: Custom page numbering: Q1, A1, Q2, A2 — How to set up? #96975
    Masood Ahmad
    Participant

    No, you can’t accomplish this in InDesign. Odd pages will have odd numbers and Even pages will have even numbers. You can definitely prefix them with Q and A, but you can’t change the sequence.

Viewing 15 posts - 106 through 120 (of 500 total)