NSSize

NSEdgeInsets


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
010
011property refMe : a reference to current application
012
013set ocidEdgeInsets to refMe's NSEdgeInsets's NSEdgeInsetsMake(0, 0, 0, 0)
014log ocidEdgeInsets
015
016-->(*top:0.0, left:0.0, bottom:0.0, right:0.0*)
AppleScriptで生成しました

|

Rect Point Size

Rect001
AppleScript サンプルコード

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

AppleScript サンプルソース(参考)
行番号ソース
001#! /usr/bin/env osascript
002----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
003#
004#  com.cocolog-nifty.quicktimer.icefloe
005----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
006use AppleScript version "2.8"
007use framework "Foundation"
008
009property refMe : a reference to current application
010
011##############################
012#RECT
013set ocidRect to refMe's NSRect's NSMakeRect(10, 20, 30, 40)
014log ocidRect as list
015-->{{10,20},{30,40}}
016log refMe's NSRect's NSMinX(ocidRect)
017log refMe's NSRect's NSMinY(ocidRect)
018
019log refMe's NSRect's NSWidth(ocidRect)
020log refMe's NSRect's NSHeight(ocidRect)
021
022log refMe's NSRect's NSMaxX(ocidRect)
023log refMe's NSRect's NSMaxY(ocidRect)
024
025log refMe's NSRect's NSMidX(ocidRect)
026log refMe's NSRect's NSMidY(ocidRect)
027
028##############################
029#
030set ocidPoint to refMe's NSPoint's NSMakePoint((refMe's NSRect's NSMinX(ocidRect)), (refMe's NSRect's NSMinY(ocidRect)))
031log ocidPoint
032log ocidPoint's x
033log ocidPoint's y
034
035set ocidSize to refMe's NSSize's NSMakeSize((refMe's NSRect's NSWidth(ocidRect)), (refMe's NSRect's NSHeight(ocidRect)))
036log ocidSize
037log ocidSize's width
038log ocidSize's height
039
040
041
AppleScriptで生成しました

|

[NSSize]よく使う記述 NSRectとの関係


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

#!/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*)




|

[NSSize]よく使う記述


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

#!/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 ocidImageSize to refMe's NSSize's NSMakeSize(1280, 720)
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*)


set recordImageSize to ocidImageSize as record
-->(*width:1280.0, height:720.0*)

set numWidth to (recordImageSize's width) as integer
--> 1280
set numHeight to (recordImageSize's height) as integer
--> 720

set numWidth to (recordImageSize's width) as number
--> 1280.0
set numHeight to (recordImageSize's height) as number
--> 720.0



|

[NSSize] NSSizeでの画像のサイズ(ピクセルサイズ)はレコードrecord


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

#!/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 framework "AppKit"
use scripting additions

property refMe : a reference to current application


set strFilePath to "/System/Library/Desktop Pictures/Big Sur Graphic.heic" as text
set ocidFilePathStr to refMe's NSString's stringWithString:(strFilePath)
set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
set ocidFilePathURL to refMe's NSURL's alloc()'s initFileURLWithPath:ocidFilePath isDirectory:false

set ocidGifImage to refMe's NSImage's alloc()'s initWithContentsOfURL:(ocidFilePathURL)
set ocidGifImageArray to ocidGifImage's representations()
set ocidGifImageRep to ocidGifImageArray's objectAtIndex:0

set recordSize to ocidGifImageRep's |size|()
log recordSize
-->(*width:6016.0, height:6016.0*)
log class of recordSize as text
-->(*record*)

set numWidth to recordSize's width
set numWidth to width of recordSize
-->6016.0

set numHeight to recordSize's height
set numHeight to height of recordSize
-->6016.0

set ocidSize to refMe's NSMakeSize(numWidth, numHeight)
-->(*width:6016.0, height:6016.0*)
log class of ocidSize as text
-->(*record*)





|

[NSSize] NSMakeSize

#!/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 ocidImageSize to refMe's NSSize's NSMakeSize(1280, 720)

log ocidImageSize
-->(*width:1280.0, height:720.0*)
log class of ocidImageSize
-->(*record*)

|

その他のカテゴリー

Accessibility Acrobat Acrobat 2020 Acrobat 2024 Acrobat AddOn Acrobat Annotation Acrobat AppleScript Acrobat ARMDC Acrobat AV2 Acrobat BookMark Acrobat Classic Acrobat DC Acrobat Dialog Acrobat Distiller Acrobat Form Acrobat GentechAI Acrobat JS Acrobat JS Word Search Acrobat Maintenance Acrobat Manifest Acrobat Menu Acrobat Merge Acrobat Open Acrobat PDFPage Acrobat Plugin Acrobat Preferences Acrobat Preflight Acrobat Print Acrobat Python Acrobat Reader Acrobat Reader Localized Acrobat Reference Acrobat Registered Products Acrobat SCA Acrobat SCA Updater Acrobat Sequ Acrobat Sign Acrobat Stamps Acrobat URL List Mac Acrobat URL List Windows Acrobat Watermark Acrobat Windows Acrobat Windows Reader Admin Admin Account Admin Apachectl Admin ConfigCode Admin configCode Admin Device Management Admin LaunchServices Admin Locationd Admin loginitem Admin Maintenance Admin Mobileconfig Admin NetWork Admin Permission Admin Pkg Admin Power Management Admin Printer Admin Printer Basic Admin Printer Custompapers Admin SetUp Admin SMB Admin softwareupdate Admin Support Admin System Information Admin TCC Admin Tools Admin Umask Admin Users Admin Volumes Admin XProtect Adobe Adobe AUSST Adobe Bridge Adobe Documents Adobe FDKO Adobe Fonts Adobe Reference Adobe RemoteUpdateManager Adobe Sap Code AppKit Apple AppleScript AppleScript Duplicate AppleScript entire contents AppleScript List AppleScript ObjC AppleScript Osax AppleScript PDF AppleScript Pictures AppleScript record AppleScript Video Applications AppStore Archive Archive Keka Attributes Automator BackUp Barcode Barcode Decode Barcode QR Bash Basic Basic Path Bluetooth BOX Browser Calendar CD/DVD Choose Chrome Chromedriver CIImage CityCode CloudStorage Color Color NSColor Color NSColorList com.apple.LaunchServices.OpenWith Console Contacts CotEditor CURL current application Date&Time delimiters Desktop Desktop Position Device Diff Disk do shell script Dock Dock Launchpad DropBox Droplet eMail Encode % Encode Decode Encode HTML Entity Encode UTF8 Error EXIFData exiftool ffmpeg File File Name Finder Finder Window Firefox Folder FolderAction Font List FontCollections Fonts Fonts Asset_Font Fonts ATS Fonts Emoji Fonts Maintenance Fonts Morisawa Fonts Python Fonts Variable Foxit GIF github Guide HTML Icon Icon Assets.car Illustrator Image Events ImageOptim Input Dictionary iPhone iWork Javascript Jedit Ω Json Label Language Link locationd lsappinfo m3u8 Mail Map Math Media Media AVAsset Media AVconvert Media AVFoundation Media AVURLAsset Media Movie Media Music Memo Messages Microsoft Microsoft Edge Microsoft Excel Microsoft Fonts Microsoft Office Microsoft Office Link Microsoft OneDrive Microsoft Teams Mouse Music Node Notes NSArray NSArray Sort NSAttributedString NSBezierPath NSBitmapImageRep NSBundle NSCFBoolean NSCharacterSet NSData NSDecimalNumber NSDictionary NSError NSEvent NSFileAttributes NSFileManager NSFileManager enumeratorAtURL NSFont NSFontManager NSGraphicsContext NSGraphicsContext Crop NSImage NSIndex NSKeyedArchiver NSKeyedUnarchiver NSLocale NSMetadataItem NSMutableArray NSMutableDictionary NSMutableString NSNotFound NSNumber NSOpenPanel NSPasteboard NSpoint NSPredicate NSRange NSRect NSRegularExpression NSRunningApplication NSScreen NSSet NSSize NSString NSString stringByApplyingTransform NSStringCompareOptions NSTask NSTimeZone NSUbiquitous NSURL NSURL File NSURLBookmark NSURLComponents NSURLResourceKey NSURLSession NSUserDefaults NSUUID NSView NSWorkspace Numbers OAuth PDF PDF Image2PDF PDF MakePDF PDF nUP PDF Pymupdf PDF Pypdf PDFContext PDFDisplayBox PDFImageRep PDFKit PDFKit Annotation PDFKit AnnotationWidget PDFKit DocumentPermissions PDFKit OCR PDFKit Outline PDFKit Start PDFPage PDFPage Rotation PDFView perl Photoshop PlistBuddy pluginkit plutil postalcode PostScript PowerShell prefPane Preview Python Python eyed3 Python pip QuickLook QuickTime ReadMe Regular Expression Reminders ReName Repeat RTF Safari SaveFile ScreenCapture ScreenSaver Script Editor Script Menu SF Symbols character id SF Symbols Entity Shortcuts Shortcuts Events sips Skype Slack Sound Spotlight sqlite StandardAdditions StationSearch Subtitles LRC Subtitles SRT Subtitles VTT Swift swiftDialog System Events System Settings 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 VMware Fusion Wacom Weather webarchive webp Wifi Windows XML XML EPUB XML HTML XML LSSharedFileList XML LSSharedFileList sfl2 XML LSSharedFileList sfl3 XML objectsForXQuery XML OPML XML Plist XML Plist System Events XML RSS XML savedSearch XML SVG XML TTML XML webloc XML xmllint XML XMP YouTube Zero Padding zoom