NSRect

[NSRect]AppleScript式だと?


サンプルコード

サンプルソース(参考)
行番号ソース
001#レコード形式
002set recordOrigin to {x:0,y:10} as record
003set recordSize to {width:360,hight:720} as record
004set listMakeRect to {recordOrigin,recordSize}as list
005log listMakeRect
006#リスト形式
007set listOrigin to {0,10} as list
008set listSize to {360,720} as list
009set listMakeRect to {recordOrigin,recordSize}as list
010log listMakeRect
AppleScriptで生成しました

|

[NSRect]listでの取得


AppleScript サンプルコード

【スクリプトエディタで開く】 |

AppleScript サンプルソース(参考)
行番号ソース
001#!/usr/bin/env osascript
002----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
003#  
004#
005# com.cocolog-nifty.quicktimer.icefloe
006----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
007use AppleScript version "2.8"
008use framework "Foundation"
009use scripting additions
010property refMe : a reference to current application
011
012
013set listMakeRect to refMe's NSRect's NSMakeRect(0, 10, 360, 720)
014
015#origin  size
016set listOrigin to (item 1 of listMakeRect) as list
017set listSize to (item 2 of listMakeRect) as list
018#origin xy
019set numX to  (item 1 of listOrigin) as number
020set numY to  (item 2 of listOrigin)as number
021#size wh
022set numW to (item 1 of listSize)as number
023set numH to (item 2 of listSize)as number
AppleScriptで生成しました

|

[NSRect] xyとwh


AppleScript サンプルコード

【スクリプトエディタで開く】 |

AppleScript サンプルソース(参考)
行番号ソース
001#!/usr/bin/env osascript
002----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
003#  
004#
005# com.cocolog-nifty.quicktimer.icefloe
006----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
007use AppleScript version "2.8"
008use framework "Foundation"
009use scripting additions
010property refMe : a reference to current application
011
012
013set ocidMakeRect to refMe's NSRect's NSMakeRect(0, 10, 360, 720)
014
015#origin xy
016set ocidX to refMe's NSRect's NSMinX(ocidMakeRect)
017set ocidY to refMe's NSRect's NSMinY(ocidMakeRect)
018#size wh
019set ocidW to refMe's NSRect's NSWidth(ocidMakeRect)
020set ocidH to refMe's NSRect's NSHeight(ocidMakeRect)
021
022log ocidX
023log ocidY
024log ocidW
025log ocidH
AppleScriptで生成しました

|

[NSRect]originとsize


AppleScript サンプルコード

【スクリプトエディタで開く】 |

AppleScript サンプルソース(参考)
行番号ソース
001#!/usr/bin/env osascript
002----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
003#  
004#
005# com.cocolog-nifty.quicktimer.icefloe
006----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
007use AppleScript version "2.8"
008use framework "Foundation"
009use scripting additions
010property refMe : a reference to current application
011
012
013set ocidMakeRect to refMe's NSRect's NSMakeRect(0, 10, 360, 720)
014# origin xy
015set ocidX to refMe's NSRect's NSMinX(ocidMakeRect)
016set ocidY to refMe's NSRect's NSMinY(ocidMakeRect)
017#相対位置の幅
018set ocidWm to refMe's NSRect's NSMaxX(ocidMakeRect)
019#相対位置の高さ
020set ocidHm to refMe's NSRect's NSMaxY(ocidMakeRect)
021#originの値を引いて 実サイズ
022set ocidW to ocidWm - ocidX
023set ocidH to ocidHm - ocidY
024
025#相対的な中央位置
026set ocidCXm to refMe's NSRect's NSMidX(ocidMakeRect)
027set ocidCym to refMe's NSRect's NSMidY(ocidMakeRect)
028#originの値を引いて 実中央
029set ocidCX to ocidCXm - ocidX
030set ocidCy to ocidCym - ocidY
031
032log ocidX
033log ocidY
034log ocidW
035log ocidH
036log ocidCX
037log ocidCy
AppleScriptで生成しました

|

その他のカテゴリー

Accessibility Acrobat Acrobat 2020 Acrobat AddOn Acrobat Annotation Acrobat ARMDC Acrobat AV2 Acrobat BookMark Acrobat Classic Acrobat DC Acrobat Dialog Acrobat Distiller Acrobat Form Acrobat JS Acrobat Manifest Acrobat Menu Acrobat Open Acrobat Plugin Acrobat Preferences Acrobat Preflight Acrobat python Acrobat Reader Acrobat SCA Acrobat SCA Updater Acrobat Sequ Acrobat Sign Acrobat Stamps Acrobat Watermark Acrobat Windows Acrobat Windows Reader Admin Admin Account Admin Apachectl Admin configCode Admin Device Management Admin LaunchServices Admin Locationd Admin loginitem Admin Maintenance Admin Mobileconfig Admin Permission Admin Pkg Admin Power Management Admin Printer Admin SetUp Admin SMB Admin Support Admin System Information Admin Tools Admin Users Admin Volumes Adobe Adobe FDKO Adobe RemoteUpdateManager AppKit Apple AppleScript AppleScript do shell script AppleScript List AppleScript ObjC AppleScript Osax AppleScript PDF AppleScript Pictures AppleScript record AppleScript Script Editor AppleScript Script Menu AppleScript Shortcuts AppleScript Shortcuts Events AppleScript System Events AppleScript System Events Plist AppleScript Video Applications AppStore Archive Attributes Automator BackUp Barcode Barcode QR Barcode QR Decode Bash Basic Basic Path Bluetooth BOX Browser Calendar CD/DVD Choose Chrome CIImage CityCode CloudStorage Color com.apple.LaunchServices.OpenWith Console Contacts CotEditor CURL current application Date&Time delimiters Desktop Device Diff Disk Dock DropBox Droplet eMail Encode % Encode Decode Encode UTF8 Error EXIFData ffmpeg File Finder Firefox Folder FolderAction Fonts GIF github Guide HTML HTML Entity Icon Illustrator Image Events Image2PDF ImageOptim iPhone iWork Javascript Jedit Json Label Leading Zero List locationd LRC lsappinfo LSSharedFileList m3u8 Mail MakePDF Map Math Media Media AVAsset Media AVconvert Media AVFoundation Media AVURLAsset Media Movie Media Music Memo Messages Microsoft Microsoft Edge Microsoft Excel Mouse Music NetWork Notes NSArray NSArray Sort NSBezierPath NSBitmapImageRep NSBundle NSCFBoolean NSCharacterSet NSColor NSColorList NSData NSDecimalNumber NSDictionary NSError NSEvent NSFileAttributes NSFileManager NSFileManager enumeratorAtURL NSFont NSFontManager NSGraphicsContext NSImage NSIndex NSKeyedArchiver NSKeyedUnarchiver NSLocale NSMutableArray NSMutableDictionary NSMutableString NSNotFound NSNumber NSOpenPanel NSPasteboard NSpoint NSPredicate NSPrintOperation NSRange NSRect NSRegularExpression NSRunningApplication NSScreen NSSize NSString NSString stringByApplyingTransform NSStringCompareOptions NSTask NSTimeZone NSURL NSURL File NSURLBookmark NSURLComponents NSURLResourceKey NSURLSession NSUserDefaults NSUUID NSView NSWorkspace Numbers OAuth OneDrive PDF PDFAnnotation PDFAnnotationWidget PDFContext PDFDisplayBox PDFDocumentPermissions PDFImageRep PDFKit PDFnUP PDFOutline perl Photoshop PlistBuddy pluginkit postalcode PostScript prefPane Preview Python QuickLook QuickTime ReadMe Regular Expression Reminders ReName Repeat RTF Safari SaveFile ScreenCapture ScreenSaver SF Symbols character id SF Symbols Entity sips Skype Slack Sound Spotlight sqlite SRT StandardAdditions Swift System Settings TCC TemporaryItems Terminal Text Text CSV Text MD Text TSV TextEdit Tools Translate Trash Twitter Typography UI Unit Conversion UTType valueForKeyPath Video VisionKit Visual Studio Code Wacom webarchive webp Wifi Windows XML XML EPUB XML OPML XML Plist XML RSS XML savedSearch XML SVG XML TTML XML webloc XML XMP YouTube zoom