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
// http://armand.eu/blog/working-with-measurement-units-in-adobe-extendscript/ | |
function changeUnitsToPixels(){ | |
if(typeof originalUnitsH === 'undefined') originalUnitsH = app.documents[0].viewPreferences.horizontalMeasurementUnits; | |
if(typeof originalUnitsV === 'undefined') originalUnitsV = app.documents[0].viewPreferences.verticalMeasurementUnits; | |
app.documents[0].viewPreferences.horizontalMeasurementUnits = app.documents[0].viewPreferences.verticalMeasurementUnits = MeasurementUnits.pixels; | |
} | |
function changeUnitsBack(){ | |
app.documents[0].viewPreferences.horizontalMeasurementUnits = originalUnitsH; | |
app.documents[0].viewPreferences.verticalMeasurementUnits = originalUnitsV; | |
delete originalUnitsH; | |
delete originalUnitsV; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment