• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

JS - change CS5 Ruler Origin to bottom/left (like CS4)

Community Expert ,
Aug 12, 2011 Aug 12, 2011

Copy link to clipboard

Copied

Hi guys, after recent user request for help with this much discussed Ruler Origin, and after Jacob having to explain how to do it modifying the user prefs, and after Wade having to explain where to find the file, I wrote a script that does all that for us. It moves the ruler origin to bottom/left or top/left on demand, without having to restart Illustrator. The change is global and permanent (until changed back). After running the script, double-click on the top/left corner of the document, where the rulers meet, to update rulers on active documents.

setRulerOrigin.png

#target Illustrator

//  script.name = switchRulerOriginToCS4nCS5.jsx;
//  script.description = switches ruler origin to bottom/left (like CS4), and back to top/left (like CS5);
//  script.required = runs on CS5 only;
//  script.parent = carlos canto // 8/12/11;
//  script.elegant = false;

var appver = Number(String(app.version).split(".")[0]);
if (appver >= 15)
    {
        //var idoc = app.activeDocument;
        var win = new Window("dialog","Set Coordinate System");

        var grpCoordinates = win.add("group");
        var grpCS4 = grpCoordinates.add("group");
        var lblCS4dummy = grpCS4.add("statictext",undefined,"CS4");
        var panely1 = grpCS4.add("panel");
        var lblCS4 = grpCS4.add("statictext",undefined,"CS4");

        var panelx = grpCoordinates.add("panel");

        var grpCS5 = grpCoordinates.add("group");
        var lblCS5dummy = grpCS5.add("statictext",undefined,"CS5");
        var panely2 = grpCS5.add("panel");
        var lblCS5 = grpCS5.add("statictext",undefined,"CS5");

        grpCoordinates.orientation = "column";

        lblCS4dummy.visible = lblCS5dummy.visible = false;

        var panelradio = win.add("panel", undefined, "Ruler Origin as in...");

        panely1.bounds = {x:0, y:0, width:0, height:60};
        panelx.bounds = {x:0, y:0, width:120, height:0};
        panely2.bounds = {x:0, y:0, width:0, height:60};

        grpCoordinates.spacing = 0;

        win.helpTip = grpCoordinates.helpTip = "Double-Click where the rulers meet to update \rCurrent Doc's Ruler Origin...";
        grpCoordinates.helpTip = "Coded by CarlosCanto";
        grpCS4.helpTip = "CS4: Positive Y moving up";
        grpCS5.helpTip = "CS5: Positive Y moving down";
        lblCS4.helpTip = lblCS5.helpTip = "Don't click me...";
       
        //add Radio buttons
        var grpRadio = panelradio.add("group");
        var radCS4 = grpRadio.add("radiobutton",undefined,"CS4");
        var radCS5 = grpRadio.add("radiobutton",undefined,"CS5");
        var btnOk = grpRadio.add("button", undefined, "Ok");
        btnOk.size = [40,25];
        btnOk.enabled = false;
        //radCenter.value = true;
       
        win.defaultElement = lblCS4dummy; // make this element default to prevent hitting "enter" to trigger ok button
       
        radCS4.onClick = function(){
            // alert(idoc.name);
            lblCS4.visible = true;
            lblCS5.visible = false;
            btnOk.enabled = true;
        }
   
        radCS5.onClick = function(){
            //alert(idoc.name);
            lblCS4.visible = false;
            lblCS5.visible = true;
            btnOk.enabled = true;
        }

        btnOk.onClick = function(){
            //alert(radCS5.value);
            app.preferences.setBooleanPreference ("isRulerOriginTopLeft",radCS5.value);
            app.preferences.setBooleanPreference ("isRulerIn4thQuad",radCS5.value);           
            win.close();
        }

        lblCS4.onClick = lblCS5.onClick = function(){
        alert("...we're so damn curious, aren't we?");
           
        }
   
        win.center();
        win.show();   
    }
else
    {
        alert("CS4 and earlier don't need this trick...good bye.")
    }

Views

13.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
LEGEND ,
Aug 12, 2011 Aug 12, 2011

Copy link to clipboard

Copied

Very nice Carlos! Thanks!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 12, 2011 Aug 12, 2011

Copy link to clipboard

Copied

That is really excellent and i think Adobe should be told about the script and it should posted on Adobe Exchange with credit to Carlos.

Thanks Carlos.

Wade

P.S. I hope you don't mind Carlos but I brought it to the attention of someone that has contact with Adobe.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 15, 2011 Aug 15, 2011

Copy link to clipboard

Copied

thanks Scott,

thanks Wade,

no problem, I didn't come up with the solution though, I just made it easy to get implemented. I don't know who posted it first, to give proper credits, Jacob posts it everytime a user ask for it.

I have no idea how to post on exchange, is it the place where it takes ages to get approved before something gets posted? according to some users.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 15, 2011 Aug 15, 2011

Copy link to clipboard

Copied

Very nice work, Carlos.

 

The first presentation of the solution that I have seen in the forum was by moluapple, in post #16, here:

http://forums.adobe.com/message/3859580?tstart=30#3859580

 

It was a great relief to have the solution, as it appears from that thread, and from the other threads I referred to along with it just a few days ago, in post #6 here:

 

http://forums.adobe.com/message/3859580?tstart=30#3859580

 

Now there is a much easier way.

 

Thank you very much.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 24, 2011 Aug 24, 2011

Copy link to clipboard

Copied

Thank you so much for this script, as a mechanical designer where the bottom left is always the origin this was driving me crazy!

I understand that their may be some precident for other origins, but it was ill advised for Adobe to not have an option for setting the origin.

Thanks for adding what Adobe should have.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 22, 2013 Feb 22, 2013

Copy link to clipboard

Copied

Neither the script nor the Prefs file change seem to work with CS6 version 16.0.4. I'd be interested to know if this is just me or whether the recent update broke the script.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 03, 2013 Sep 03, 2013

Copy link to clipboard

Copied

Hi there phunkidude, I see your comment is from months ago but, I searched for a solution to this vexing issue only today, even though it's been bugging me for months. I am on CS6 16.0.4, Mac platform and it did work for me.

Copy the script from above. Open ExtendScript Toolkit.app, create a new file and paste the code into the window of the app. Save as 'whatever-name-you-prefer.jsx' on your Desktop, or somewhere else you can easily find the file. (ExtendScript Toolkit.app is probably located here: Macintosh HD/Applications/Utilities/Adobe Utilities-CS6/ExtendScript Toolkit CS6) Not sure where it's located on a Windows system.

Open Illustrator. From Illustrator's Menu, select 'File/Scripts/Other Scripts...' then navigate to the .jsx file you just saved on your Desktop. Select the file and click "Open". The script will then run and you will see the little dialog box as shown above. If you want the XY origin at bottom-left, click the radio button for CS4. If you want things starting from top-left, select CS5.

The interesting thing in this whole issue is that no one considered having this option included natively (I'm talking to you, Adobe!!) in the Workspace profile for Printing and Proofing or Illustration, and having the XY origin at left-top for Web, which would seemingly include any screen, (such as video) where your workflow includes those other apps such as Photoshop, Flash or Fireworks.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 07, 2019 Feb 07, 2019

Copy link to clipboard

Copied

Thanks for noting that the script is to be used in ExtendScript. This worked for me with Illustrator CS 6 version 16.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 03, 2013 Sep 03, 2013

Copy link to clipboard

Copied

CarlosCanto,

Such a terrific contribution! Danke schön!, muito obrigado, thank you very much!!!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 11, 2014 Sep 11, 2014

Copy link to clipboard

Copied

Carlos, you made my day! Thank you for sharing this gem.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 07, 2019 Feb 07, 2019

Copy link to clipboard

Copied

Thanks. You saved me from feeling like I am measuring upside down. The only problem I had was that I never did any programming and thought the script was for Terminal. Fortunately, I reviewed this page again after trying it and found the reply that said to use ExtendScript. By the way, this worked for Illustrator CS 6.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 07, 2021 Apr 07, 2021

Copy link to clipboard

Copied

I may be missing something obvious but, can anyone tell me if I can or how I can do this in the current version (that is 'Adobe Illustrator 2021' - v 25.2.1) of Illustrator?

 

Thanks, 

Dave

 

Note (Rant)

For the life of me, I truly can't understand how or why any company chooses to change a core behavior that they've had practically forever. *If* they would ever speak up and offer some form of logic or reason for such a change- perhaps it would/could make more sense to me as a user. Otherwise- it looks like a mistake or oversight that they're unwilling to acknowledge. If anyone has any insight please share your info./thoughts.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Apr 07, 2021 Apr 07, 2021

Copy link to clipboard

Copied

Dave, can we assume you ran the script and it didn't work?

Try running it from ExtendScript instead and see if it offers any de-bug info, it's possible that some terminology in javaScript has been changed since this was posted in 2011.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 09, 2021 Apr 09, 2021

Copy link to clipboard

Copied

LATEST

Thank you!

I discovered I had not used the .jsx extension, therefore the script was not showing up when I tried to run it. A truly basic mistake, but I'm new to using scripts and scripting.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 07, 2021 Apr 07, 2021

Copy link to clipboard

Copied

Copy the script code from Carlos Canto above.

Create a text only document.

Paste the code.

Save on the desktop (or another place that is simple to find) with the .jsx extension.

In Illustrator choose: File > Scripts > Other Script... and select the script you saved.

Select CS4 and click OK

(That practically forever behaviour was changed 11 years ago).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines