Image Events

[Image Events] 画像の各種値を取得する


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 scripting additions
008
009#############################
010###ダイアログ
011set strName to (name of current application) as text
012if strName is "osascript" then
013  tell application "Finder" to activate
014else
015  tell current application to activate
016end if
017
018tell application "Finder"
019  set aliasDefaultLocation to (path to pictures folder from user domain) as alias
020end tell
021
022set listUTI to {"public.image"} as list
023set strMes to ("ファイルを選んでください") as text
024set strPrompt to ("ファイルを選んでください") as text
025
026try
027  ### ファイル選択時
028  set listAliasFilePath to (choose file strMes with prompt strPrompt default location aliasDefaultLocation of type listUTI with invisibles, multiple selections allowed and showing package contents) as list
029on error
030  log "エラーしました"
031  return "エラーしました"
032end try
033if listAliasFilePath is {} then
034  return "選んでください"
035end if
036
037#リストの中のファイル数
038set numCntFile to (count of listAliasFilePath) as integer
039
040#リストの中のファイル数だけ繰り返し
041repeat with itemNo from 1 to (numCntFile) by 1
042  
043  tell application "Image Events"
044    launch
045    set objImage to open (item itemNo of listAliasFilePath)
046    #縦横解像度
047    set listResolution to (resolution of objImage) as list
048    #ピクセルサイズ
049    set listDimensions to (dimensions of objImage) as list
050    #解像度
051    set strR to item 1 of listResolution as number
052    #幅ピクセル
053    set strW to item 1 of listDimensions as number
054    #縦ピクセル
055    set strH to item 2 of listDimensions as number
056    set strColorSpace to (color space of objImage) as text
057    set strFileType to (file type of objImage) as text
058    set strFileName to (name of objImage) as text
059    ##set strEmbeddedProfileof to name of (embedded profile of objImage)
060    close objImage
061  end tell
062  
063end repeat
064
065
066
067
AppleScriptで生成しました

|

[Image Events]FileとAliasによる挙動

要はこの違いです

set strImageFilePath to "/Library/User Pictures/Animals/Eagle.tif"

set fileImageFilePath to POSIX file strImageFilePath
---> file "

set aliasImageFilePath to (POSIX file strImageFilePath) as alias
---> alias "



結論を先に
1:ファイル単体:Fileパス形式でImage Eventsに渡す
2:リスト形式の場合:aliasリスト形式でImage Eventsに渡す
これが現時点での使用方法なのかなと



例 ファイルが単体の場合


fileだと各種値を取得できます
set strImageFilePath to "/Library/User Pictures/Animals/Eagle.tif"

set fileImageFilePath to POSIX file strImageFilePath
---> file "

tell application "Image Events"
launch
set objImage to open fileImageFilePath
set listResolution to (resolution of objImage) as list
set listDimensions to (dimensions of objImage) as list
set strR to item 1 of listResolution as text
set strW to item 1 of listDimensions as text
set strH to item 2 of listDimensions as text
set strColorSpace to (color space of objImage) as text
set strFileType to (file type of objImage) as text
set strFileName to (name of objImage) as text
##set strEmbeddedProfileof to name of (embedded profile of objImage)
close objImage
end tell

##########
tell application "Image Events"
launch
open file "Macintosh HD:Library:User Pictures:Animals:Eagle.tif"
--> image "Eagle.tif"
get resolution of image "Eagle.tif"
--> {72.0, 72.0}
get dimensions of image "Eagle.tif"
--> {512, 512}
get color space of image "Eagle.tif"
--> RGB
get file type of image "Eagle.tif"
--> TIFF
get name of image "Eagle.tif"
--> "Eagle.tif"
close image "Eagle.tif"
end tell


エイリアスをOPENすると値は取得できません。

set strImageFilePath to "/Library/User Pictures/Animals/Eagle.tif"

set aliasImageFilePath to (POSIX file strImageFilePath) as alias
---> alias "

tell application "Image Events"
launch
set objImage to open aliasImageFilePath
set listResolution to (resolution of objImage) as list
set listDimensions to (dimensions of objImage) as list
set strR to item 1 of listResolution as text
set strW to item 1 of listDimensions as text
set strH to item 2 of listDimensions as text
set strColorSpace to (color space of objImage) as text
set strFileType to (file type of objImage) as text
set strFileName to (name of objImage) as text
##set strEmbeddedProfileof to name of (embedded profile of objImage)
close objImage
end tell

###
#missing valueとなって値を取得できません



リスト形式の場合


フォルダの中にあるファイルのリスト
set strImageDIr to "/Library/User Pictures/Animals"

set aliasImageDIr to (POSIX file strImageDIr) as alias
---> alias "Macintosh HD:Library:User Pictures:Animals:"

tell application "Finder"
set objEveryDoc to (every file of aliasImageDIr)
end tell
--->get every file of alias "Macintosh HD:Library:User Pictures:Animals:"
--> {document file }


フォルダの中にあるファイルのエイリアスのリスト

tell application "Finder"
set listAliasPath to every file in aliasImageDIr as alias list
end tell
-->get every file of alias "Macintosh HD:Library:User Pictures:Animals:"
--> {alias }




ファイルのリストの場合
set strImageDIr to "/Library/User Pictures/Animals"

set aliasImageDIr to (POSIX file strImageDIr) as alias
---> alias "Macintosh HD:Library:User Pictures:Animals:"

tell application "Finder"
set objEveryDoc to (every file of aliasImageDIr)
end tell

tell application "Image Events"
launch
set objImage to open (item 1 of objEveryDoc)
set listResolution to (resolution of objImage) as list
set listDimensions to (dimensions of objImage) as list
set strR to item 1 of listResolution as text
set strW to item 1 of listDimensions as text
set strH to item 2 of listDimensions as text
set strColorSpace to (color space of objImage) as text
set strFileType to (file type of objImage) as text
set strFileName to (name of objImage) as text
##set strEmbeddedProfileof to name of (embedded profile of objImage)
close objImage
end tell

###
#イメージファイルを対応のアプリで開いてしまいますので、値を取れません。



エリアスリストの場合は期待通りの動作となります


set strImageDIr to "/Library/User Pictures/Animals"

set aliasImageDir to (POSIX file strImageDIr) as alias
---> alias "Macintosh HD:Library:User Pictures:Animals:"

tell application "Finder"
set listAliasPath to every file in aliasImageDir as alias list
end tell

tell application "Image Events"
launch
set objImage to open item 1 of listAliasPath
set listResolution to (resolution of objImage) as list
set listDimensions to (dimensions of objImage) as list
set strR to item 1 of listResolution as text
set strW to item 1 of listDimensions as text
set strH to item 2 of listDimensions as text
set strColorSpace to (color space of objImage) as text
set strFileType to (file type of objImage) as text
set strFileName to (name of objImage) as text
##set strEmbeddedProfileof to name of (embedded profile of objImage)
close objImage
end tell

tell application "Image Events"
launch
open alias "Macintosh HD:Library:User Pictures:Animals:Eagle.tif"
--> image "Eagle.tif"
get resolution of image "Eagle.tif"
--> {72.0, 72.0}
get dimensions of image "Eagle.tif"
--> {512, 512}
get color space of image "Eagle.tif"
--> RGB
get file type of image "Eagle.tif"
--> TIFF
get name of image "Eagle.tif"
--> "Eagle.tif"
close image "Eagle.tif"
end tell

|

[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を使う

macOS12でImage Eventsを使うときのポイント
要点はファイルを『エイリアスのリスト』で渡す事でした

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




tell application "Image Events"
launch
set objImage to open item numImageCnt of listChooseFile
set listResolution to (resolution of objImage) as list
set listDimensions to (dimensions of objImage) as list
set strR to item 1 of listResolution as text
set strW to item 1 of listDimensions as text
set strH to item 2 of listDimensions as text
set strColorSpace to (color space of objImage) as text
set strFileType to (file type of objImage) as text
set strFileName to (name of objImage) as text
set strEmbeddedProfileof to name of (embedded profile of objImage)
close objImage
end tell


#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7

use AppleScript version "2.8"
use framework "Foundation"
use scripting additions
property objMe : a reference to current application
property objNSString : a reference to objMe's NSString





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


set cntImageFile to (count of listChooseFile) as number
set numImageCnt to 1
repeat cntImageFile times

tell application "Finder"

set objInfo to info for item numImageCnt of listChooseFile
set strFinderName to name of objInfo
set strFinderSize to size of objInfo
set strCreationDate to creation date of objInfo
set strkind to kind of objInfo
set strUTI to type identifier of objInfo

set textMbPer to "0.0009765625" as text
set textKbPer to "0.001" as text
log objInfo
set numKb to round (strFinderSize * textKbPer)
set numMb to (numKb * textMbPer)
set strOutPut to ""


set strOutPut to strOutPut & "@@@@@@@@@@@@@@@@@@@@@\n"
set strOutPut to strOutPut & "##############Finder\n"
set strOutPut to strOutPut & "FinderName\t" & strFinderName & "\n"
set strOutPut to strOutPut & "FinderSize\t" & strFinderSize & " バイト\n"
set strOutPut to strOutPut & "FinderSize\t" & numKb & " KB\n"
set strOutPut to strOutPut & "FinderSize\t" & numMb & " MB\n"
set strOutPut to strOutPut & "kind\t" & strkind & "\n"
set strOutPut to strOutPut & "type identifier\t" & strUTI & "\n"

set strOutPut to strOutPut & "CreationDate\t" & strCreationDate & "\n"



end tell


tell application "Image Events"
launch
set objImage to open item numImageCnt of listChooseFile
set listResolution to (resolution of objImage) as list
set listDimensions to (dimensions of objImage) as list
set strR to item 1 of listResolution as text
set strW to item 1 of listDimensions as text
set strH to item 2 of listDimensions as text
set strColorSpace to (color space of objImage) as text
set strFileType to (file type of objImage) as text
set strFileName to (name of objImage) as text
set strEmbeddedProfileof to name of (embedded profile of objImage)
close objImage
end tell

set strOutPut to strOutPut & "##############Image Events\n"
set strOutPut to strOutPut & "resolution\t" & strR & "\n"
set strOutPut to strOutPut & "dimensionsW\t" & strW & "\n"
set strOutPut to strOutPut & "dimensionsH\t" & strH & "\n"
set strOutPut to strOutPut & "ColorSpace\t" & strColorSpace & "\n"
set strOutPut to strOutPut & "FileType\t" & strFileType & "\n"
set strOutPut to strOutPut & "FileName\t" & strFileName & "\n"
set strOutPut to strOutPut & "embedded profile\t" & strEmbeddedProfileof & "\n"

log strOutPut



set numImageCnt to numImageCnt + 1
end repeat


tell current application
path to desktop from user domain
--> alias "Macintosh HD:Users:XXXXXXXXX:Desktop:"
end tell
tell application "Script Editor"
choose file with prompt "ファイルを選んでください" default location alias "Macintosh HD:Users:XXXXXXX:Desktop:" of type {"public.image"} with invisibles and multiple selections allowed without showing package contents
--> {alias "Macintosh HD:System:Library:Desktop Pictures:.thumbnails:Big Sur Aerial.heic", alias "Macintosh HD:System:Library:Desktop Pictures:.thumbnails:Big Sur Coastline.heic", alias "Macintosh HD:System:Library:Desktop Pictures:.thumbnails:Big Sur Dark.heic", alias "Macintosh HD:System:Library:Desktop Pictures:.thumbnails:Big Sur Graphic Dark.heic", alias "Macintosh HD:System:Library:Desktop Pictures:.thumbnails:Big Sur Graphic Light.heic", alias "Macintosh HD:System:Library:Desktop Pictures:.thumbnails:Big Sur Graphic.heic"}
end tell
tell application "Finder"
info for alias "Macintosh HD:System:Library:Desktop Pictures:.thumbnails:Big Sur Aerial.heic"
--> error number -10004
end tell
tell current application
info for alias "Macintosh HD:System:Library:Desktop Pictures:.thumbnails:Big Sur Aerial.heic"
--> {name:"Big Sur Aerial.heic", creation date:date "2022226 土曜日 16:05:07", modification date:date "2022226 土曜日 16:05:07", size:29804, folder:false, alias:false, package folder:false, visible:true, extension hidden:false, name extension:"heic", displayed name:"Big Sur Aerial.heic", default application:alias "Macintosh HD:System:Applications:Preview.app:", kind:"HEIFイメージ", file type:"", file creator:"", type identifier:"public.heic", locked:false, busy status:false, short version:"", long version:""}
end tell
tell application "Finder"
(*name:Big Sur Aerial.heic, creation date:date 2022226 土曜日 16:05:07, modification date:date 2022226 土曜日 16:05:07, size:29804, folder:false, alias:false, package folder:false, visible:true, extension hidden:false, name extension:heic, displayed name:Big Sur Aerial.heic, default application:alias Macintosh HD:System:Applications:Preview.app:, kind:HEIFイメージ, file type:, file creator:, type identifier:public.heic, locked:false, busy status:false, short version:, long version:*)
end tell
tell current application
round 29.804
--> 30
end tell
tell application "Image Events"
launch
open alias "Macintosh HD:System:Library:Desktop Pictures:.thumbnails:Big Sur Aerial.heic"
--> image "Big Sur Aerial.heic"
get resolution of image "Big Sur Aerial.heic"
--> {300.0, 300.0}
get dimensions of image "Big Sur Aerial.heic"
--> {356, 356}
get color space of image "Big Sur Aerial.heic"
--> RGB
get file type of image "Big Sur Aerial.heic"
--> missing value
get name of image "Big Sur Aerial.heic"
--> "Big Sur Aerial.heic"
get name of embedded profile of image "Big Sur Aerial.heic"
--> "Display P3"
close image "Big Sur Aerial.heic"
end tell
(*@@@@@@@@@@@@@@@@@@@@@
##############Finder
FinderNameBig Sur Aerial.heic
FinderSize29804 バイト
FinderSize30 KB
FinderSize0.029296875 MB
kindHEIFイメージ
type identifierpublic.heic
CreationDate2022226 土曜日 16:05:07
##############Image Events
resolution300.0
dimensionsW356
dimensionsH356
ColorSpaceRGB
FileTypemissing value
FileNameBig Sur Aerial.heic
embedded profileDisplay P3
*)
tell application "Finder"
info for alias "Macintosh HD:System:Library:Desktop Pictures:.thumbnails:Big Sur Coastline.heic"
--> error number -10004
end tell
tell current application
info for alias "Macintosh HD:System:Library:Desktop Pictures:.thumbnails:Big Sur Coastline.heic"
--> {name:"Big Sur Coastline.heic", creation date:date "2022226 土曜日 16:05:07", modification date:date "2022226 土曜日 16:05:07", size:42490, folder:false, alias:false, package folder:false, visible:true, extension hidden:false, name extension:"heic", displayed name:"Big Sur Coastline.heic", default application:alias "Macintosh HD:System:Applications:Preview.app:", kind:"HEIFイメージ", file type:"", file creator:"", type identifier:"public.heic", locked:false, busy status:false, short version:"", long version:""}
end tell
tell application "Finder"
(*name:Big Sur Coastline.heic, creation date:date 2022226 土曜日 16:05:07, modification date:date 2022226 土曜日 16:05:07, size:42490, folder:false, alias:false, package folder:false, visible:true, extension hidden:false, name extension:heic, displayed name:Big Sur Coastline.heic, default application:alias Macintosh HD:System:Applications:Preview.app:, kind:HEIFイメージ, file type:, file creator:, type identifier:public.heic, locked:false, busy status:false, short version:, long version:*)
end tell
tell current application
round 42.49
--> 42
end tell
tell application "Image Events"
launch
open alias "Macintosh HD:System:Library:Desktop Pictures:.thumbnails:Big Sur Coastline.heic"
--> image "Big Sur Coastline.heic"
get resolution of image "Big Sur Coastline.heic"
--> {72.0, 72.0}
get dimensions of image "Big Sur Coastline.heic"
--> {356, 356}
get color space of image "Big Sur Coastline.heic"
--> RGB
get file type of image "Big Sur Coastline.heic"
--> missing value
get name of image "Big Sur Coastline.heic"
--> "Big Sur Coastline.heic"
get name of embedded profile of image "Big Sur Coastline.heic"
--> "Display P3"
close image "Big Sur Coastline.heic"
end tell
(*@@@@@@@@@@@@@@@@@@@@@
##############Finder
FinderNameBig Sur Coastline.heic
FinderSize42490 バイト
FinderSize42 KB
FinderSize0.041015625 MB
kindHEIFイメージ
type identifierpublic.heic
CreationDate2022226 土曜日 16:05:07
##############Image Events
resolution72.0
dimensionsW356
dimensionsH356
ColorSpaceRGB
FileTypemissing value
FileNameBig Sur Coastline.heic
embedded profileDisplay P3
*)
tell application "Finder"
info for alias "Macintosh HD:System:Library:Desktop Pictures:.thumbnails:Big Sur Dark.heic"
--> error number -10004
end tell
tell current application
info for alias "Macintosh HD:System:Library:Desktop Pictures:.thumbnails:Big Sur Dark.heic"
--> {name:"Big Sur Dark.heic", creation date:date "2022226 土曜日 16:05:07", modification date:date "2022226 土曜日 16:05:07", size:21911, folder:false, alias:false, package folder:false, visible:true, extension hidden:false, name extension:"heic", displayed name:"Big Sur Dark.heic", default application:alias "Macintosh HD:System:Applications:Preview.app:", kind:"HEIFイメージ", file type:"", file creator:"", type identifier:"public.heic", locked:false, busy status:false, short version:"", long version:""}
end tell
tell application "Finder"
(*name:Big Sur Dark.heic, creation date:date 2022226 土曜日 16:05:07, modification date:date 2022226 土曜日 16:05:07, size:21911, folder:false, alias:false, package folder:false, visible:true, extension hidden:false, name extension:heic, displayed name:Big Sur Dark.heic, default application:alias Macintosh HD:System:Applications:Preview.app:, kind:HEIFイメージ, file type:, file creator:, type identifier:public.heic, locked:false, busy status:false, short version:, long version:*)
end tell
tell current application
round 21.911
--> 22
end tell
tell application "Image Events"
launch
open alias "Macintosh HD:System:Library:Desktop Pictures:.thumbnails:Big Sur Dark.heic"
--> image "Big Sur Dark.heic"
get resolution of image "Big Sur Dark.heic"
--> {72.0, 72.0}
get dimensions of image "Big Sur Dark.heic"
--> {356, 356}
get color space of image "Big Sur Dark.heic"
--> RGB
get file type of image "Big Sur Dark.heic"
--> missing value
get name of image "Big Sur Dark.heic"
--> "Big Sur Dark.heic"
get name of embedded profile of image "Big Sur Dark.heic"
--> "Display P3"
close image "Big Sur Dark.heic"
end tell
(*@@@@@@@@@@@@@@@@@@@@@
##############Finder
FinderNameBig Sur Dark.heic
FinderSize21911 バイト
FinderSize22 KB
FinderSize0.021484375 MB
kindHEIFイメージ
type identifierpublic.heic
CreationDate2022226 土曜日 16:05:07
##############Image Events
resolution72.0
dimensionsW356
dimensionsH356
ColorSpaceRGB
FileTypemissing value
FileNameBig Sur Dark.heic
embedded profileDisplay P3
*)
tell application "Finder"
info for alias "Macintosh HD:System:Library:Desktop Pictures:.thumbnails:Big Sur Graphic Dark.heic"
--> error number -10004
end tell
tell current application
info for alias "Macintosh HD:System:Library:Desktop Pictures:.thumbnails:Big Sur Graphic Dark.heic"
--> {name:"Big Sur Graphic Dark.heic", creation date:date "2022226 土曜日 16:05:07", modification date:date "2022226 土曜日 16:05:07", size:27119, folder:false, alias:false, package folder:false, visible:true, extension hidden:false, name extension:"heic", displayed name:"Big Sur Graphic Dark.heic", default application:alias "Macintosh HD:System:Applications:Preview.app:", kind:"HEIFイメージ", file type:"", file creator:"", type identifier:"public.heic", locked:false, busy status:false, short version:"", long version:""}
end tell
tell application "Finder"
(*name:Big Sur Graphic Dark.heic, creation date:date 2022226 土曜日 16:05:07, modification date:date 2022226 土曜日 16:05:07, size:27119, folder:false, alias:false, package folder:false, visible:true, extension hidden:false, name extension:heic, displayed name:Big Sur Graphic Dark.heic, default application:alias Macintosh HD:System:Applications:Preview.app:, kind:HEIFイメージ, file type:, file creator:, type identifier:public.heic, locked:false, busy status:false, short version:, long version:*)
end tell
tell current application
round 27.119
--> 27
end tell
tell application "Image Events"
launch
open alias "Macintosh HD:System:Library:Desktop Pictures:.thumbnails:Big Sur Graphic Dark.heic"
--> image "Big Sur Graphic Dark.heic"
get resolution of image "Big Sur Graphic Dark.heic"
--> {72.0, 72.0}
get dimensions of image "Big Sur Graphic Dark.heic"
--> {356, 356}
get color space of image "Big Sur Graphic Dark.heic"
--> RGB
get file type of image "Big Sur Graphic Dark.heic"
--> missing value
get name of image "Big Sur Graphic Dark.heic"
--> "Big Sur Graphic Dark.heic"
get name of embedded profile of image "Big Sur Graphic Dark.heic"
--> "Display P3"
close image "Big Sur Graphic Dark.heic"
end tell
(*@@@@@@@@@@@@@@@@@@@@@
##############Finder
FinderNameBig Sur Graphic Dark.heic
FinderSize27119 バイト
FinderSize27 KB
FinderSize0.0263671875 MB
kindHEIFイメージ
type identifierpublic.heic
CreationDate2022226 土曜日 16:05:07
##############Image Events
resolution72.0
dimensionsW356
dimensionsH356
ColorSpaceRGB
FileTypemissing value
FileNameBig Sur Graphic Dark.heic
embedded profileDisplay P3
*)
tell application "Finder"
info for alias "Macintosh HD:System:Library:Desktop Pictures:.thumbnails:Big Sur Graphic Light.heic"
--> error number -10004
end tell
tell current application
info for alias "Macintosh HD:System:Library:Desktop Pictures:.thumbnails:Big Sur Graphic Light.heic"
--> {name:"Big Sur Graphic Light.heic", creation date:date "2022226 土曜日 16:05:07", modification date:date "2022226 土曜日 16:05:07", size:30874, folder:false, alias:false, package folder:false, visible:true, extension hidden:false, name extension:"heic", displayed name:"Big Sur Graphic Light.heic", default application:alias "Macintosh HD:System:Applications:Preview.app:", kind:"HEIFイメージ", file type:"", file creator:"", type identifier:"public.heic", locked:false, busy status:false, short version:"", long version:""}
end tell
tell application "Finder"
(*name:Big Sur Graphic Light.heic, creation date:date 2022226 土曜日 16:05:07, modification date:date 2022226 土曜日 16:05:07, size:30874, folder:false, alias:false, package folder:false, visible:true, extension hidden:false, name extension:heic, displayed name:Big Sur Graphic Light.heic, default application:alias Macintosh HD:System:Applications:Preview.app:, kind:HEIFイメージ, file type:, file creator:, type identifier:public.heic, locked:false, busy status:false, short version:, long version:*)
end tell
tell current application
round 30.874
--> 31
end tell
tell application "Image Events"
launch
open alias "Macintosh HD:System:Library:Desktop Pictures:.thumbnails:Big Sur Graphic Light.heic"
--> image "Big Sur Graphic Light.heic"
get resolution of image "Big Sur Graphic Light.heic"
--> {72.0, 72.0}
get dimensions of image "Big Sur Graphic Light.heic"
--> {356, 356}
get color space of image "Big Sur Graphic Light.heic"
--> RGB
get file type of image "Big Sur Graphic Light.heic"
--> missing value
get name of image "Big Sur Graphic Light.heic"
--> "Big Sur Graphic Light.heic"
get name of embedded profile of image "Big Sur Graphic Light.heic"
--> "Display P3"
close image "Big Sur Graphic Light.heic"
end tell
(*@@@@@@@@@@@@@@@@@@@@@
##############Finder
FinderNameBig Sur Graphic Light.heic
FinderSize30874 バイト
FinderSize31 KB
FinderSize0.0302734375 MB
kindHEIFイメージ
type identifierpublic.heic
CreationDate2022226 土曜日 16:05:07
##############Image Events
resolution72.0
dimensionsW356
dimensionsH356
ColorSpaceRGB
FileTypemissing value
FileNameBig Sur Graphic Light.heic
embedded profileDisplay P3
*)
tell application "Finder"
info for alias "Macintosh HD:System:Library:Desktop Pictures:.thumbnails:Big Sur Graphic.heic"
--> error number -10004
end tell
tell current application
info for alias "Macintosh HD:System:Library:Desktop Pictures:.thumbnails:Big Sur Graphic.heic"
--> {name:"Big Sur Graphic.heic", creation date:date "2022226 土曜日 16:05:07", modification date:date "2022226 土曜日 16:05:07", size:32724, folder:false, alias:false, package folder:false, visible:true, extension hidden:false, name extension:"heic", displayed name:"Big Sur Graphic.heic", default application:alias "Macintosh HD:System:Applications:Preview.app:", kind:"HEIFイメージ", file type:"", file creator:"", type identifier:"public.heic", locked:false, busy status:false, short version:"", long version:""}
end tell
tell application "Finder"
(*name:Big Sur Graphic.heic, creation date:date 2022226 土曜日 16:05:07, modification date:date 2022226 土曜日 16:05:07, size:32724, folder:false, alias:false, package folder:false, visible:true, extension hidden:false, name extension:heic, displayed name:Big Sur Graphic.heic, default application:alias Macintosh HD:System:Applications:Preview.app:, kind:HEIFイメージ, file type:, file creator:, type identifier:public.heic, locked:false, busy status:false, short version:, long version:*)
end tell
tell current application
round 32.724
--> 33
end tell
tell application "Image Events"
launch
open alias "Macintosh HD:System:Library:Desktop Pictures:.thumbnails:Big Sur Graphic.heic"
--> image "Big Sur Graphic.heic"
get resolution of image "Big Sur Graphic.heic"
--> {72.0, 72.0}
get dimensions of image "Big Sur Graphic.heic"
--> {356, 356}
get color space of image "Big Sur Graphic.heic"
--> RGB
get file type of image "Big Sur Graphic.heic"
--> missing value
get name of image "Big Sur Graphic.heic"
--> "Big Sur Graphic.heic"
get name of embedded profile of image "Big Sur Graphic.heic"
--> "Display P3"
close image "Big Sur Graphic.heic"
end tell
(*@@@@@@@@@@@@@@@@@@@@@
##############Finder
FinderNameBig Sur Graphic.heic
FinderSize32724 バイト
FinderSize33 KB
FinderSize0.0322265625 MB
kindHEIFイメージ
type identifierpublic.heic
CreationDate2022226 土曜日 16:05:07
##############Image Events
resolution72.0
dimensionsW356
dimensionsH356
ColorSpaceRGB
FileTypemissing value
FileNameBig Sur Graphic.heic
embedded profileDisplay P3
*)

|

その他のカテゴリー

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 VMware Fusion 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