【スクリプトエディタで開く】|
#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions
property refMe : a reference to current application
set ocidImageRect to refMe's NSRect's NSMakeRect(120, 360, 1280, 720)
log ocidImageRect
-->(*120.0, 360.0, 1280.0, 720.0*)
log class of ocidImageRect
-->(*list*)
#######
log item 1 of ocidImageRect
(*120.0, 360.0*)
set ocidImagePoint to refMe's NSPoint's NSPointFromCGPoint(item 1 of ocidImageRect)
log ocidImagePoint
-->(*x:120.0, y:360.0*)
log class of ocidImagePoint
-->(*record*)
#
set numX to ocidImagePoint's x
set numX to x of ocidImagePoint
--> 120.0
log class of numX
--> (*real*)
set numY to ocidImagePoint's y
set numY to y of ocidImagePoint
--> 360.0
log class of numY
--> (*real*)
#######
log item 2 of ocidImageRect
(*1280.0, 720.0*)
set ocidImageSize to refMe's NSSize's NSSizeFromCGSize(item 2 of ocidImageRect)
log ocidImageSize
-->(*width:1280.0, height:720.0*)
log class of ocidImageSize
-->(*record*)
#
set numWidth to ocidImageSize's width
set numWidth to width of ocidImageSize
--> 1280
log class of numWidth
--> (*real*)
#
set numHeight to ocidImageSize's height
set numHeight to height of ocidImageSize
--> 720
log class of numHeight
--> (*real*)