Hi Wade, I scripted it the way Marie originally wanted it, by defining a "window". keyboard short cuts for scripts do not stick I have made a coupe of tutorials on how to run scripts via 2-clicks and shortcut key stroke for Windose. They don't involve programming, so I wonder if there are similar features on the Mac that could do something similar. Hover the mouse over my username to check those out. #target Illustrator // script.name = selectWithinRect.jsx; // script.description = selects all items fully enclosed by a top most Rectangle; // script.required = draw the "selection Marquee" Rectangle first before running; // script.parent = carlos canto // 5/25/11; // script.elegant = false; var idoc = app.activeDocument; var topPath = idoc.pathItems[0]; var tpVB = topPath.visibleBounds; var left = tpVB[0]; var top = tpVB[1]; var right = tpVB[2]; var bottom = tpVB[3]; for (i = 1 ; i<idoc.pageItems.length; i++) { var iart = idoc.pageItems; if (isPointIn(top,left,bottom,right,iart) == "true") { iart.selected = true; } //alert(isPointIn(top,left,bottom,right,iart)); } topPath.remove(); function isPointIn(top,left,bottom,right,iart) { var vb = iart.visibleBounds; ileft = vb[0]; itop = vb[1]; iright = vb[2]; ibottom = vb[3]; if ( ileft>left && itop<top && iright<right && ibottom>bottom) return "true"; else return "false"; }
... View more