ã¤ã©ã¬JavaScript - ããã©ã«ãåç¹ã¨ãã«ãã¢ã¼ããã¼ãã¸ã®å¯¾å¿æ¡
ã¤ã©ã¬ã®ã¹ã¯ãªãã㧠CS5 ã®ããã©ã«ãåç¹å¤æ´ã«å¯¾å¿ããæ¹æ³ãèãã¦ã¿ãã
æåã«åç¹ãã¢ã¯ãã£ããªã¢ã¼ããã¼ãã®å·¦ä¸ã«ç§»ããæå¾ã«å
ã«æ»ãã¨ãããã®ã
CS3 以åã§ã¯ãç¹ã«åç¹ã®ä½ç½®ãå¤æ´ããªãã
Win ç Illustrator CS, CS3, CS4, CS5 ã§åä½ç¢ºèªã
â» 21:25 å°ãä¿®æ£ãã¾ãããï¼this.activeDocument ã¨ãªã£ã¦ãç®æã app.activeDocument ã«è¨æ£ï¼
â» 2013.02.11ï¼ãä¿®æ£ãthis ã«ããå¿
è¦ããªãã¨ãã㯠var ã«ãã¾ããã
// --------------------------------------------------------- // A fix for the change of the document origin in CS5, // and for the multi-artboard in CS4 or later. // This function locates the active artboard's origin on the // bottom left at first, and restores it at the end. // // USAGE: // var g_origin = Origin(); // ... (do something in legacy style) // g_origin.restore(); function Origin(){ var ver15_or_later = (parseFloat(version.substr(0, 2)) >= 15); // CS5 or later var ver14 = (version.substr(0, 2) == "14"); // CS4 if(ver15_or_later){ var saved_coord_system = app.coordinateSystem; app.coordinateSystem = CoordinateSystem.ARTBOARDCOORDINATESYSTEM; var idx = app.activeDocument.artboards.getActiveArtboardIndex(); var ab = app.activeDocument.artboards[idx]; var o = ab.rulerOrigin; var r = ab.artboardRect; var saved_origin = [o[0], o[1]]; ab.rulerOrigin = [0, r[1] - r[3]]; } else if(ver14){ var o = app.activeDocument.rulerOrigin; var saved_origin = [o[0], o[1]]; app.activeDocument.rulerOrigin = [0, 0]; } this.restore = function(){ if(ver15_or_later){ ab.rulerOrigin = saved_origin; app.coordinateSystem = saved_coord_system; } else if(ver14){ app.activeDocument.rulerOrigin = saved_origin; } }; return this; } // --------------------------------------------------------- var g_origin = Origin(); main(); g_origin.restore();
ä½ã£ã¦ãæä¸ã«ãç¾å¨å
¬éä¸ã®ã¹ã¯ãªãã㯠CS4 ã®ãã«ãã¢ã¼ããã¼ãã«å¯¾å¿ãã¦ãªãã£ããã ã¨ããã£ãã
CS4 ãå
¥æããã®ãæè¿ãªãã®ã§ãè¿ããã¡ã« CS5 対å¿ã¨ä½µãã¦æ´æ°ãã¾ãã