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

Viewing "Actual Size"

Explorer ,
Mar 31, 2011 Mar 31, 2011

Copy link to clipboard

Copied

HI,

I've always wondered why, if I set the screen view to "Actual Size" or even 100%, that if measured against a ruler put up to the monitor, it does not correspond. Is there a view or setting that can do this without me zooming in or zooming out and measureing with a ruler every time? (I'm feeling this might be so simple I'm going to once again be embarrassed....

Thanks.

TOPICS
Performance

Views

53.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
Advisor ,
Apr 02, 2011 Apr 02, 2011

Copy link to clipboard

Copied

I created this script few months ago... Maybe it can help...

var monitorDiag = Number(22);
var zoomTo = 100; // eg. for 50% input 50 and so on...

if(app.documents.length){
    var myScreen = (function(){return [($.screens.toString().split("-")[1].toString().split(":")[0]), ($.screens.toString().split("-")[1].toString().split(":")[1])]})();
    var monitorWidth = (myScreen[0] > myScreen[1] ? myScreen[0] : myScreen[1]);
    var monitorHeight = (myScreen[0] < myScreen[1] ? myScreen[0] : myScreen[1]);
    var myZoom = Math.round(((Math.sqrt(Math.pow(monitorWidth,2)+Math.pow(monitorHeight,2))/monitorDiag)/72)*100);
    app.activeWindow.zoomPercentage = myZoom * (zoomTo / 100);
}

Just input your screen diagonal size and zoom percentage you want to achieve.

Hope that helps.

--

Marijan (tomaxxi)

http://indisnip.wordpress.com/

http://inditip.wordpress.com/

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 ,
Apr 02, 2011 Apr 02, 2011

Copy link to clipboard

Copied

OK, so here's a variant of tomaxxi's script that actually reads the EDID size information.

There's a lot to go wrong here, so it might not work for you. I'm not near any multiple-monitor macs at the moment, so I can't test it on one of those, so in particular the ioreg command may read the EDID info for the wrong monitor.

According to Wikipedia, the millimeter sizes at offsets 66,67, and 68 into the EDID info are only valid for non-null pixel clocks (bytes 54-55). In my case that's what I have, but you might not. Also, this reads from Descriptor Block 1, I don't know when to pick which descriptor block to use (I am too lazy to go figure it out, I guess...). I suppose you could easily fall back to using bytes 21 and 22, the maximum sizes, as a commented out earlier version of the script did.

Also, if the EDID info is for the correct monitor, I might not be using the correct entry in the ExtendScript $.screens array. I pick 0, and again, am too lazy to go grab the spec to see which one is right. (Not that it's clear how to decide which monitor to use...)

Oh, also, I calculate based on the horizontal resolution (better precision? Ha!). Since ID doesn't let you set the horizontal zoom independent of the vertical zoom (thank goodness!), we have to pick one anyhow... I suppose I could have gone with the diagonal (best of both worlds?), but that was more math and made things more complicated anyhow...

tomaxxi, I am mystified why you use a function to set myScreen, and also why you do all that string manipulation...anyhow, I rewrote that part.

Oh, and because I am disinclined to do string maniuplation in AppleScript, this is written in JavaScript, which has no support for executing shell scripts, and you need to run the ioreg command to get EDID info. So we have my function shell() which quotes the arguments and passes them to AppleScript so it can pass them to the shell. Oof. Here you go -- oh yes, M Blackburn, you can just paste in JavaScript:

function shell(cmd) {
    var
        rv,
        call ='do shell script "'+
            cmd.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+
            '"';
    try {
        rv = app.doScript(call,
            ScriptLanguage.APPLESCRIPT_LANGUAGE);
    } catch(e0) {
        rv = e0+"\n"+(rv?"":rv);
    }
    return rv;
}



(function() {
    var raw, hex, i, edid = [], hin, hmm, hmmhi,
        zoomTo, hrez, myZoom;
raw = shell('ioreg -Srk IODisplayEDID -w 0 | grep IODisplayEDID');
    hex = raw.replace(/.*<(.*)>.*/,"$1");
    for (i = 0; i<(hex.length/2); i++)  {
       edid = parseInt(hex.substr(i*2,2),16);
    }
//http://en.wikipedia.org/wiki/Extended_display_identification_data
    // hcm = edid[21]; // 21: max horizontal size (cm)
    hmmhi = (edid[68] & 0xf0) << 5;
    hmm = hmmhi | edid[66];
    hin = hmm/25.4;
    if(app.documents.length){
        zoomTo = 100;
        hrez = $.screens[0].right-$.screens[0].left;
        myZoom = Math.round(hrez/hin/72*100);
        app.activeWindow.zoomPercentage = myZoom * (zoomTo / 100);
    }   
}());

Edit: reads the "EDID size" information not the "EDID resolution" information -- whoops!

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 ,
Apr 03, 2011 Apr 03, 2011

Copy link to clipboard

Copied

There's a lot to go wrong here, so it might not work for you. I'm not near any multiple-monitor macs at the moment, so I can't test it on one of those, so in particular the ioreg command may read the EDID info for the wrong monitor.

…

Also, if the EDID info is for the correct monitor, I might not be using the correct entry in the ExtendScript $.screens array. I pick 0, and again, am too lazy to go grab the spec to see which one is right. (Not that it's clear how to decide which monitor to use...)

OK, fixed for multiple monitors. Several changes: 1) Adjust the regexp to read the first of multiple EDID entries if there are any. 2) Get hrez from the EDID information rather than $.screens, so it always matches up. 3) Correct a bitshifting error in hmmhi -- shift by 4 not by 5; not sure what I was thinking.

Seems to work for me on this multiple (3) monitor mac...

function shell(cmd) {     var         rv,         call ='do shell script "'+             cmd.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+             '"';     try {         rv = app.doScript(call,             ScriptLanguage.APPLESCRIPT_LANGUAGE);     } catch(e0) {         rv = e0+"\n"+(rv?"":rv);     }     return rv; } (function() {     var raw, hex, i, edid = [], hin, hmm, hmmhi,         zoomTo, hrez, myZoom; raw = shell('ioreg -Srk IODisplayEDID -w 0 | grep IODisplayEDID');     hex = raw.replace(/^.*?<([^>]*)>.*/,"$1");     for (i = 0; i<(hex.length/2); i++)  {        edid = parseInt(hex.substr(i*2,2),16);     } //http://en.wikipedia.org/wiki/Extended_display_identification_data     // hcm = edid[21]; // 21: max horizontal size (cm)     hmmhi = (edid[68] & 0xf0) << 4;     hmm = hmmhi | edid[66];     hin = hmm/25.4;                             hrez = (((edid[58]  & 0xf0) << 4) | edid[56]);     if(app.documents.length){         zoomTo = 100;         myZoom = Math.round(hrez/hin/72*100);         app.activeWindow.zoomPercentage = myZoom * (zoomTo / 100);     }    }());

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 06, 2011 Apr 06, 2011

Copy link to clipboard

Copied

Seems to work for me on this multiple (3) monitor mac...

I get NaN as the zoom value in OSX10.6.4

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 ,
Apr 06, 2011 Apr 06, 2011

Copy link to clipboard

Copied

Whoops? Perhaps add

    $.writeln([edid[21], edid[68], edid[66],

        edid[68], edid[56], hrez, hin].join(","));

before the "if" and let me know what it says?

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, 2011 Apr 07, 2011

Copy link to clipboard

Copied

All your variables are coming up as 0s.

Screen shot 2011-04-07 at 8.02.40 AM.png

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 ,
Apr 07, 2011 Apr 07, 2011

Copy link to clipboard

Copied

Sigh...I guess I should have asked a different question...what does

ioreg -lw 0 | grep -i edid
show in the Terminal?

Though maybe you're one of these:

According to Wikipedia, the millimeter sizes at offsets 66,67, and 68 into the EDID info are only valid for non-null pixel clocks (bytes 54-55). In my case that's what I have, but you might not.

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
Enthusiast ,
Apr 07, 2011 Apr 07, 2011

Copy link to clipboard

Copied

LATEST

Somewhere around 137% works on my 2 monitors.


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
Guest
Mar 31, 2011 Mar 31, 2011

Copy link to clipboard

Copied

Zoom something of a known width and measure it with a ruler until you get true 100%

Make note of the zoom amount (131% for my setup)

Open a text file and add this code:

try {app.layoutWindows[0].zoomPercentage = 131 } catch (e) {};

Save as Zoom131.jsx (or whatever name.jsx) into your scripts folder

Edit keyboard shortcuts to set Ctrl-1 to run your script (if you want 131% instead of 100%)

Duplicate/edit/rename script for 200%, 50% etc and add shortcuts if desired...

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 06, 2011 Apr 06, 2011

Copy link to clipboard

Copied

Great thread! We discussed this in podcast 4, many moons ago, and included a one line script from Dave Saunders:  http://indesignsecrets.com/indesignsecrets-004.php

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 ,
Apr 06, 2011 Apr 06, 2011

Copy link to clipboard

Copied

There's some funny irony with us posting the long scripts verbatim and Dave's 1-line script being inside a .zip file. Here it is for comparison:

try {app.layoutWindows[0].zoomPercentage = 140 } catch (e) {};

Of course it's short since it doesn't do any math and hardcodes to 140%.

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 06, 2011 Apr 06, 2011

Copy link to clipboard

Copied

That is funny. (technically the reason we used zip was to force download of the jsx file.)  It's so much easier to hold a ruler to the screen and figure the proper resolution than to do the math.

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 ,
Apr 06, 2011 Apr 06, 2011

Copy link to clipboard

Copied

David,

This line in your .htaccess file will force jsx files to download:

AddType application/octet-stream .jsx

Harbs

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