Created
May 9, 2017 13:44
-
-
Save anonymous/8e316ae2955ce2ea4e62932066a7fffe to your computer and use it in GitHub Desktop.
This file contains 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 characters
// G331_unitSwitch.jsx | |
// ミリ単位とピクセル単位をすぐに切り替えるスクリプトです | |
// http://gorolib.blog.jp/archives/70501774.html | |
// 0:inch, 1:mm, 2:pt, 3:pica, 4:cm, 5:Q/H, 6:px | |
PRE = app.preferences | |
ptEQ = 25.4/72 | |
CKL = 0.1/ptEQ // mmのときのキー入力値です | |
if(PRE.getIntegerPreference('rulerType')==6){ | |
// 単位がpxだったらmmへ | |
PRE.setIntegerPreference('rulerType', 1) // mm | |
PRE.setIntegerPreference('strokeUnits', 1) // mm | |
PRE.setIntegerPreference('text/units', 2) // pt | |
PRE.setIntegerPreference('text/asianunits', 2) // pt | |
PRE.setRealPreference("cursorKeyLength", CKL) // キー入力値は0.1mm | |
alert('単位をmmに変更しました') | |
} else { | |
// 単位がpx以外だったらpxへ | |
PRE.setIntegerPreference('rulerType', 6) // px | |
PRE.setIntegerPreference('strokeUnits', 6) // px | |
PRE.setIntegerPreference('text/units', 6) // px | |
PRE.setIntegerPreference('text/asianunits', 6) // px | |
PRE.setRealPreference("cursorKeyLength", 0.5) // キー入力値は0.5px | |
alert('単位をpxに変更しました') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment