AppleScript名:display情報の取得 |
— Created 2015-01-13 by Takaaki Naganoya — 2015 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" use framework "AppKit" –Retina Displayを含む構成のとき(macOS 10.10.x) set dInfoList to retScreenInfos() –> {{screenSize:{{width:1920.0, height:1200.0}}, screenResol:{{width:144.0, height:144.0}}, screenIsScreen:true, screenNumber:"69501832", screenColorSpace:"NSCalibratedRGBColorSpace", screenColDepth:"8"}, {screenSize:{{width:1920.0, height:1200.0}}, screenResol:{{width:144.0, height:144.0}}, screenIsScreen:true, screenNumber:"69513475", screenColorSpace:"NSCalibratedRGBColorSpace", screenColDepth:"8"}, {screenSize:{{width:1920.0, height:1200.0}}, screenResol:{{width:144.0, height:144.0}}, screenIsScreen:true, screenNumber:"69731202", screenColorSpace:"NSCalibratedRGBColorSpace", screenColDepth:"8"}, {screenSize:{{width:1920.0, height:1080.0}}, screenResol:{{width:72.0, height:72.0}}, screenIsScreen:true, screenNumber:"458586661", screenColorSpace:"NSCalibratedRGBColorSpace", screenColDepth:"8"}} –Retina Displayを含む構成のとき(macOS 10.12.6) –> {{screenSize:{{width:1920.0, height:1200.0}}, screenResol:{{width:144.0, height:144.0}}, screenIsScreen:true, screenNumber:"69731202", screenColorSpace:"NSCalibratedRGBColorSpace", screenColDepth:"8"}, {screenSize:{{width:1920.0, height:1080.0}}, screenResol:{{width:72.0, height:72.0}}, screenIsScreen:true, screenNumber:"458586661", screenColorSpace:"NSCalibratedRGBColorSpace", screenColDepth:"8"}} –Retina Displayを含まない構成のとき(MacBook Pro Retina本体のLid Closed Mode時)(macOS 10.10.x) –set dInfoList to retScreenInfos() –> {{screenSize:{{width:1920.0, height:1200.0}}, screenResol:{{width:72.0, height:72.0}}, screenIsScreen:true, screenNumber:"69501832", screenColorSpace:"NSCalibratedRGBColorSpace", screenColDepth:"8"}, {screenSize:{{width:1920.0, height:1200.0}}, screenResol:{{width:72.0, height:72.0}}, screenIsScreen:true, screenNumber:"69513475", screenColorSpace:"NSCalibratedRGBColorSpace", screenColDepth:"8"}, {screenSize:{{width:1920.0, height:1080.0}}, screenResol:{{width:72.0, height:72.0}}, screenIsScreen:true, screenNumber:"458586661", screenColorSpace:"NSCalibratedRGBColorSpace", screenColDepth:"8"}} –Retina Displayを含まない構成のとき(MacBook Pro Retina本体のLid Closed Mode時)(macOS 10.12.6) –> {{screenSize:{{width:1920.0, height:1200.0}}, screenResol:{{width:72.0, height:72.0}}, screenIsScreen:true, screenNumber:"69501831", screenColorSpace:"NSCalibratedRGBColorSpace", screenColDepth:"8"}, {screenSize:{{width:1920.0, height:1200.0}}, screenResol:{{width:72.0, height:72.0}}, screenIsScreen:true, screenNumber:"69513476", screenColorSpace:"NSCalibratedRGBColorSpace", screenColDepth:"8"}, {screenSize:{{width:1920.0, height:1080.0}}, screenResol:{{width:72.0, height:72.0}}, screenIsScreen:true, screenNumber:"458586661", screenColorSpace:"NSCalibratedRGBColorSpace", screenColDepth:"8"}} on retScreenInfos() set sList to (current application’s NSScreen’s screens()) as list set dList to {} repeat with i in sList set a to i’s deviceDescription() set aSize to a’s NSDeviceSize as list set aResol to a’s NSDeviceResolution as list set aScrn to a’s NSDeviceIsScreen as boolean set aNum to a’s NSScreenNumber as string set aColSpc to a’s NSDeviceColorSpaceName as string set aColDepth to a’s NSDeviceBitsPerSample as string set the end of dList to {screenSize:aSize, screenResol:aResol, screenIsScreen:aScrn, screenNumber:aNum, screenColorSpace:aColSpc, screenColDepth:aColDepth} end repeat return dList end retScreenInfos |
More from my site
(Visited 68 times, 1 visits today)