« [Image Events]macOS12でImage Eventsを使う | トップページ | [com.apple.smb.server]DOSCodePage »

[NSImageRep]イメージデータの縦横を取得する

ダウンロード - nsimagerep.scpt.zip




#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
(*
Class
NSImageRep
https://developer.apple.com/documentation/appkit/nsimagerep
*)
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7

use AppleScript version "2.8"

use scripting additions
use framework "Foundation"
use framework "AppKit"
property objMe : a reference to current application
###property objNSImage : a reference to objMe's objNSImage
property objNSColorSpaceName : a reference to objMe's NSColorSpaceName

set aliasDefDir to path to desktop folder from user domain


set listChooseFile to (choose file with prompt "ファイルを選んでください" default location aliasDefDir of type {"public.image"} with invisibles and multiple selections allowed without showing package contents) as list


repeat with objFile in listChooseFile

set theFilePath to POSIX path of objFile
set imageInfo to (objMe's NSBitmapImageRep's imageRepWithContentsOfFile:theFilePath)


tell imageInfo
log bitsPerSample()
#####
log pixelsHigh()
log pixelsWide()
#####
log pixelsHigh()
log pixelsWide()
#####
log bitsPerPixel()
log bytesPerPlane()
log bitmapFormat()
log samplesPerPixel()
log hasAlpha()
log isOpaque()
log isPlanar()
log layoutDirection()

log colorSpaceName()

end tell




end repeat

|

« [Image Events]macOS12でImage Eventsを使う | トップページ | [com.apple.smb.server]DOSCodePage »

AppleScript Image Events」カテゴリの記事

AppleScript NSImage」カテゴリの記事

AppleScript NSBitmapImageRep」カテゴリの記事