You are not logged in.
Hello,
I've been searching all morning for a method to find the color profile currently used by each connected display. We've been using the below Image Events call but running this on OS Monterey is returning "missing value".
Applescript:
tell application "Image Events"
launch
tell displays to set {cnt, dName, sProfiles} to {count it, name, display profile}
tell its display "Display 1"
set thisProfile to display profile
end tell
end tell
Does anyone know of a different method to find this info in Monterey? system_profiler doesn't seem to have anything either.
Offline
I am on Catalina, so I'm not sure following "chevron" script will solve your problem.
Applescript:
set theScript to ¬
"tell «class capp» \"Image Events\"
tell displays to set {cnt, dName, sProfiles} to {«event corecnte» it, «property pnam», «property mPrf»}
set thisProfile to «property mPrf» of «class disp» \"Display 1\"
end tell"
tell application "Image Events" to set theProfile to run script theScript
Model: MacBook Pro
OS X: Catalina 10.15.7
Web Browser: Safari 14.1
Ram: 4 GB
Offline
Unfortunately that returns the same "missing value" result. Thanks for trying though.
Offline
Try this:
Applescript:
set displayInfo to do shell script "system_profiler -xml SPDisplaysDataType"
set displayKey to "<key>_IODisplayEDID</key>"
set nameKey to "<key>_name</key>" & return & tab & tab & tab & tab & tab & tab & "<string>"
set {tempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, displayKey}
set {displayItems, AppleScript's text item delimiters} to {text items of displayInfo, tempTID}
set displayProfileNames to {}
repeat with anItem in rest of displayItems
set here to (offset of nameKey in anItem) + (length of nameKey)
set there to (offset of "</string>" in (text here thru -1 of anItem)) - 1
set end of displayProfileNames to text here thru (here + there - 1) of anItem
end repeat
Last edited by KniazidisR (2022-05-09 01:43:53 pm)
Model: MacBook Pro
OS X: Catalina 10.15.7
Web Browser: Safari 14.1
Ram: 4 GB
Offline
I found something similar but that is only finding the display's name not actually the color profile being used by that display. I'm in need of the color profile instead of the display's name.
Offline
You can use NSScreen class of Objective C as well to obtain all info for main screen. Here, I obtain for example 2 properties of main screen: display name & name of color space (that is, display profile):
Applescript:
use AppleScript version "2.4" -- Yosemite (10.10) or later
use framework "AppKit"
use scripting additions
tell (current application's NSScreen's mainScreen())
set displayName to localizedName() as text
set colorSpace to (localizedName() of colorSpace()) as text
end tell
return {Display_Name:displayName, Color_Space:colorSpace}
Last edited by KniazidisR (2022-05-09 09:34:53 pm)
Model: MacBook Pro
OS X: Catalina 10.15.7
Web Browser: Safari 14.1
Ram: 4 GB
Offline
Ooh, that works! Exactly what I'm looking for! Thanks so much.
Next question, is there a way to look at all screens versus just the main screen? I had seen this command to get all NSScreen screens:
Applescript:
set theScreens to current application's NSScreen's screens
but don't know how to use each of those in a script like you just posted for main screen.
Offline
KniazidisR. Doesn't NSScreen require the AppKit framework?
2018 Mac mini - macOS Monterey - Script Debugger 8
Offline
KniazidisR. Doesn't NSScreen require the AppKit framework?
Yes, I will update the script above.
Last edited by KniazidisR (2022-05-09 09:45:43 pm)
Model: MacBook Pro
OS X: Catalina 10.15.7
Web Browser: Safari 14.1
Ram: 4 GB
Offline
Next question, is there a way to look at all screens versus just the main screen? I had seen this command to get all NSScreen screens:
Applescript:
set theScreens to current application's NSScreen's screens
but don't know how to use each of those in a script like you just posted for main screen.
You can use repeat loop:
Applescript:
use AppleScript version "2.4" -- Yosemite (10.10) or later
use framework "AppKit"
use scripting additions
set theScreens to current application's NSScreen's screens()
set DisplaysInfoList to {}
repeat with nextScreen in theScreens
tell nextScreen
set displayName to localizedName() as text
set colorSpace to (localizedName() of colorSpace()) as text
end tell
set end of DisplaysInfoList to {Display_Name:displayName, Color_Space:colorSpace}
end repeat
return DisplaysInfoList
Last edited by KniazidisR (2022-05-09 09:40:25 pm)
Model: MacBook Pro
OS X: Catalina 10.15.7
Web Browser: Safari 14.1
Ram: 4 GB
Offline
Thanks so much
Offline