-
-
Save kingtosh/d3304ed73d07174d6806d76cd6dd55b3 to your computer and use it in GitHub Desktop.
Revisions
-
UskeS revised this gist
Apr 16, 2019 . 1 changed file with 5 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,11 +5,14 @@ var newSelection = []; app.doScript(main, ScriptLanguage.JAVASCRIPT, null, UndoModes.ENTIRE_SCRIPT); function main(){ var tempRuler = doc.viewPreferences.rulerOrigin; doc.viewPreferences.rulerOrigin = RulerOrigin.SPREAD_ORIGIN; for (var i=sel.length-2; i>=0; i--) { var n = tgt.duplicate([sel[i].visibleBounds[1], sel[i].visibleBounds[0]]); sel[i].remove(); newSelection.push(n); } doc.viewPreferences.rulerOrigin = tempRuler; doc.selection = newSelection; alert("終了しました"); }; -
UskeS created this gist
Apr 16, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ var doc = app.activeDocument; var sel = doc.selection; var tgt = sel[sel.length-1]; var newSelection = []; app.doScript(main, ScriptLanguage.JAVASCRIPT, null, UndoModes.ENTIRE_SCRIPT); function main(){ for (var i=sel.length-2; i>=0; i--) { var n = tgt.duplicate([sel[i].visibleBounds[1], sel[i].visibleBounds[0]]); sel[i].remove(); newSelection.push(n); } doc.selection = newSelection; }; alert("終了しました");