Skip to content

Instantly share code, notes, and snippets.

@MarshySwamp
Created November 16, 2019 10:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MarshySwamp/898ae3237305787d0683125166aeb480 to your computer and use it in GitHub Desktop.
Save MarshySwamp/898ae3237305787d0683125166aeb480 to your computer and use it in GitHub Desktop.
Code Snippet: Save and Restore Dialogs or Rulers
// Save the current ruler units and set to pixels
var savedRuler = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
// Do stuff...
// Restore the ruler units
app.preferences.rulerUnits = savedRuler;
// Save the current dialog display settings
var savedDisplayDialogs = app.displayDialogs;
app.displayDialogs = DialogModes.NO;
// Do stuff...
// Restore the dialogs
app.displayDialogs = savedDisplayDialogs;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment