using indesign menu select all then object pathfinder intersect using script
Learn / Forums / InDesign Add-ons (Scripts, Scripting, and Plug-ins) / using indesign menu select all then object pathfinder intersect using script
Tagged: indesign menu options
- This topic has 4 replies, 3 voices, and was last updated 7 years, 9 months ago by Ari Singer.
-
AuthorPosts
-
-
March 9, 2014 at 11:33 pm #67518Abdul RazzakMember
i want to execute indesign menu options in sequence using script. i.e first edit – > select all . then object -> pathfinder -> intersect. How do i do that using script.
-
June 9, 2016 at 2:00 pm #85621Matt IsaacParticipant
does anyone have a solution to this? I am working on writing my first script and would like to add pathfinder to it.
-
June 14, 2016 at 12:21 pm #85749Ari SingerMember
Try this:
var myArray = app.activeWindow.activePage.allPageItems; myArray[0].intersectPath(myArray);
-
June 14, 2016 at 1:51 pm #85753Matt IsaacParticipant
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 =). -
June 14, 2016 at 6:02 pm #85764Ari SingerMember
Skemicle, the ‘and’ operator (‘&&’) is an equality operator, not an assignment operator.
This script should work:
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") } }
-
-
-
AuthorPosts
- You must be logged in to reply to this topic.