Script won't work on newer Mac
last year, wrote illustrator script (that pastes multiple files) coworker works remotely. worked fine.
recently, upgraded mac os 10.8.5 (but still uses illustator cs5) , script nothing-- dialog boxes come up, instead of pasting contents , saving new document dies. since not in office, fixing problem seems challenging.
i'd make sure not missing big , easy, os 10.8 having broke in script. though seems unlikely me, possible mac problem? thoughts?
here's script:
/* how use
setup: have pdfs in 1 folder. create directory in same folder called "saveloc"
in illustrator: 1. have document open object want pasted each file selected 2. group selection 3. copy selected item 4. run script: file->scripts->other scripts (choose script selection window */ // var holds selection copied var docselection = app.activedocument.selection; // if there selection made... if ( docselection.length > 0 ) { // brings dialog box asks select folder of files modify var fold = folder.selectdialog( "choose folder containing files wish modify", "~" ); // files in chosen folder stored in "files" array files = new array; // looking pdfs in chosen folder filetype = "*.pdf"; // fill array pdfs files = fold.getfiles( filetype ); // loop through chosen pdfs (that populate "files") for ( i=0; < files.length; i++ ) { // opens each document in selected folder app.open(files[i]); // add new layer app.activedocument.layers.add(); // paste in what's in clipboard app.paste(); // assign pasted stuff name pasted = app.activedocument.selection; // position pasted stuff [x, y] pasted[0].position = [(19.215),(993.523)]; // put layer pasted item @ bottom of layer stack app.activedocument.activelayer.zorder(zordermethod.sendtoback); // stores name of open doc var dsname = app.activedocument.name // gives new file name (same old) path save location var savename = new file (app.activedocument.path + "/saveloc/" + dsname); // pdf saving options set... saveopts = new pdfsaveoptions(); saveopts.compatibility = pdfcompatibility.acrobat6; saveopts.generatethumbnails = true; saveopts.preserveeditability = false; // "false" keeps file size low // save it! app.activedocument.saveas( savename, saveopts ); // close active doc app.activedocument.close(); }; // ...if no selection made, send prompt } else { alert( "select object in file, , copy it" ); };
i wonder if issues you're experiencing relate somehow topic or similar?
More discussions in Illustrator Scripting
adobe
Comments
Post a Comment