AppleScript名:画面情報を取得する |
use AppleScript version "2.4" — Yosemite (10.10) or later use framework "Foundation" use framework "AppKit" use scripting additions set allInfo to {} set theScreens to current application’s NSScreen’s screens() repeat with aScreen in theScreens set theInfo to aScreen’s deviceDescription() as record set theInfo to theInfo & aScreen’s frame() as record set end of allInfo to theInfo end repeat return allInfo –> {{NSDeviceResolution:{width:144.0, height:144.0}, NSDeviceSize:{width:1920.0, height:1200.0}, NSDeviceIsScreen:"YES", NSScreenNumber:2.077752445E+9, NSDeviceColorSpaceName:"NSCalibratedRGBColorSpace", NSDeviceBitsPerSample:8, origin:{x:0.0, y:0.0}, |size|:{width:1920.0, height:1200.0}}} –> {{NSDeviceResolution:{width:144.0, height:144.0}, NSDeviceSize:{width:1920.0, height:1200.0}, NSDeviceIsScreen:"YES", NSScreenNumber:69731202, NSDeviceColorSpaceName:"NSCalibratedRGBColorSpace", NSDeviceBitsPerSample:8, origin:{x:0.0, y:0.0}, |size|:{width:1920.0, height:1200.0}}, {NSDeviceResolution:{width:72.0, height:72.0}, NSDeviceSize:{width:1920.0, height:1080.0}, NSDeviceIsScreen:"YES", NSScreenNumber:458586661, NSDeviceColorSpaceName:"NSCalibratedRGBColorSpace", NSDeviceBitsPerSample:8, origin:{x:1920.0, y:216.0}, |size|:{width:1920.0, height:1080.0}}} |
More from my site
(Visited 63 times, 1 visits today)