Back

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

Forum Replies Created

Viewing 15 posts - 31 through 45 (of 77 total)
  • Author
    Posts
  • in reply to: Export All Open Doc to JPG #85992
    Matt Isaac
    Participant

    In your script, I notice that you have some variables that are not assigned a value. What is the purpose of assigning a variable but not giving it a value?
    example:var myFilePath;
    var myFile;
    etc...

    Also within the loop you call the variables without indicating they are variables
    example:myPage = myPages[j]; whereas you do in other instances: var myFile = new File(myFilePath); Is there reason for this?

    in reply to: Export All Open Doc to JPG #85986
    Matt Isaac
    Participant

    /*This is just a question not a solution to the problem as far as i know*/
    Kai, for the multiple pages could you call a separate function within the for loop eg.

    for var i = 0; i < allDocs.length; exportPages i++)
    function exoprtPages(){
    for (var n = 0; n < app.document.pages.length; n++){
    }}

    Then use the same export method for each page within a document before moving to the next document?

    in reply to: Cut photo in half along curved path #85857
    Matt Isaac
    Participant

    Yeah i tried to work the try/catch block into my script but without copy/pasting yours i couldn’t get it to work so i just went with what i knew. I will experiment with try/catch and eventually get the hang of it.
    —–
    Turns out the try/catch statement works just as the if/else statement.
    —–
    Here is my updated script:

    //Scripted by Skemicle
    //with assistance from Ari S
    if (parseFloat(app.version) < 6)
    main();
    else
    app.doScript(main, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, "Splice Image Along Path");
    function main() {
    	try{
    		var sel = app.selection;
    		var orig = sel[0];
    		var path = sel[1];
    		var top = sel[0].duplicate();
    		path.subtractPath(top);
    		var half1 = top.duplicate();
    		top.subtractPath(orig);
    		app.selection = null;
    	}
    	catch(error){
    		alert("Please, make sure you have selected an image and an overlapping path.");
    	}
    }

    Thanks for your assistance Ari.

    in reply to: Cut photo in half along curved path #85848
    Matt Isaac
    Participant

    Here is the script. I had some difficulty with the pathfinder so I enlisted the help of Ari who created a script to do this. Here is Ari’s script:

    app.doScript(main, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, "Subtract Paths");
    function main() {
        try{
            var mySelection = app.selection;
            var myPicture = mySelection[0];
            var myPath = mySelection[1];
            var topPicture = myPicture.duplicate();
            var half1 = myPath.subtractPath(myPicture);
            var newPath = half1.duplicate();
            var half2 = newPath.subtractPath(topPicture);
            var myGroup = half1.parent.groups.add ([half1, half2]);
            app.select(myGroup);
            } catch(myError) {
                alert("Make sure you selected 2 path items")
                }
            }

    Here is my script with Ari’s assistance in the pathfinder portion and the thought of adding undo:

    //Scripted by Skemicle
    //with assistance from Ari S
    if (parseFloat(app.version) < 6)
    main();
    else
    app.doScript(main, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, "Splice Image Along Path");
    function main() {
    	if(app.selection.length == 2){
    		var sel = app.selection;
    		var orig = sel[0];
    		var path = sel[1];
    		var top = sel[0].duplicate();
    		path.subtractPath(top);
    		var half1 = top.duplicate();
    		top.subtractPath(orig);
    		app.selection = null;
    	}
    	else{
    		alert("Please, make sure you have selected an image and an overlapping path.");
    	}
    }

    Both scripts do basically the same thing. the main difference is that Ari’s script groups the two halves of the image and leaves the group selected while my script leaves the two halves ungrouped and nothing selected.

    in reply to: Ruler guide spread across pages #85812
    Matt Isaac
    Participant

    you can pull a guide into the master page and it will appear on every page that has the master page style applied to it.

    Matt Isaac
    Participant

    This doesn’t work for any number that goes past the thousands place followed by the end of a story

    Matt Isaac
    Participant

    I am trying to use the subtract option with two objects. My current script code is:

    function main(){
    var mySelections = app.selection;
    var bottomObject = mySelections[0];
    var cutLine = mySelections[1];
    var topObject = bottomObject.duplicate();
    var topPath = topObject && cutLine;
    }
     

    Which works to duplicate the bottom object but now i need to use the subtract pathfinder option for the topObject and cutLine (topPath). I am trying to script a solution for my post in https://creativepro.com/topic/cut-photo-in-half-along-curved-path

    I tried using your bit of code in my script changing a few things to topPath[0].subtractPath(topPath); but it didn’t work.
    maybe you can once again improve upon my idea =).

    in reply to: Image text layers? #85646
    Matt Isaac
    Participant

    There you go, coming in and improving upon my ideas again Ari. (I’m glad you do, i get to learn more and become a better InDesigner.) Thanks; that works a lot better than my solution. The text in this case also remains editable so no need for redoing the whole thing if you want to change fonts or anything.

    in reply to: Image text layers? #85628
    Matt Isaac
    Participant

    Step3 creating the outlines should have taken away the text box when you did it leaving only the text as shapes. It’s weird that it didn’t. But you can use the same method with different shapes. Just skip step 3.

    Matt Isaac
    Participant

    does anyone have a solution to this? I am working on writing my first script and would like to add pathfinder to it.

    in reply to: GREP: How to find the spaces after numbers #85587
    Matt Isaac
    Participant

    ^(\d+) Will find any number of digits at the beginning of a paragraph followed by a space. The parenthesis around (\d+) specify that as a “found string.” Replace with $1 will insert the first found string.

    in reply to: Image text layers? #85550
    Matt Isaac
    Participant

    I was thinking “Set the blending mode to multiply and the text to white.” but that let darker colors of the underlying image show through the solid color. If you don’t have dark colors in the background image this may work for you. What i would suggest would be to cut the text out of the colored rectangle. This will make the text a bit harder to edit but would give you the result you’re looking for.

    1. Create a colored rectangle. (not a text box.)
    2. Create a text box with the text styled and positioned as you want it to be over the colored rectangle. (You can change the color of the text to help position the text if you need to.)
    3. With the text selected click Type>>Create Outlines
      • For whatever reason I have found that if you do this with multi-line text then creating outlines will group each line together, Thus making the final step not work properly. If you have multiple lines of text to be cut, after you create the outlines, you will want to switch to the direct selection tool and then back to the regular selection tool. (I’m not sure why this happens but it does.) Though if you only have a single line of text you can skip this tool switch.
    4. with the outlines still selected Shift+click the colored rectangle to select both objects.
    5. Use the pathfinders option “Subtract”

    After following these steps you will have your colored rectanlge with the text cut out and you can then set the opacity of the box to let as much of the background image through as you want.

    I hope this helped without causing too much confusion for you.

    in reply to: "No Styles" My Foot… #85510
    Matt Isaac
    Participant

    I had this problem as well; text would default to Minion Pro whenever I created a new document. I was able to set my default to Arial no hyphenation by adjusting the basic paragraph style with no documents open. I have had no further issues with text defaulting to Minion Pro. However, I don’t know about a “No Style” alternative for paragraph styles.

    in reply to: Cross reference in tables #85476
    Matt Isaac
    Participant

    Using the cross reference tool. The text will not automatically update in the second table; though you can click on the “update cross references” button in the cross reference panel and that should update the text for you.

    in reply to: Grep code works inside indesign but not in script #85309
    Matt Isaac
    Participant

    I don’t know much about scripts but I do know that the double forward slash creates a comment. so anything following double forward slashes will not be read by the script. Remove those and try again.

Viewing 15 posts - 31 through 45 (of 77 total)