是否有一种方法可以使用Applescript或至少使用命令行恢复加载的监视器颜色配置文件,因为我可以在Applescript中使用命令行?我指的是所有插入显示器的加载颜色配置文件,即“系统首选项->显示->颜色”中定义的颜色配置文件。
编辑:我想获得ICC配置文件的名称,即在“系统首选项”中为每个连接的屏幕选择“->显示->颜色”中选择的内容。
发布于 2020-02-23 20:15:45
尝试以下两种方法之一:
tell application "Image Events" to display profile of displays as list
tell application "Image Events" to display profile of display 1您可以在Image下的Image字典中获得更多(但不多)的详细信息。
显示0和显示1似乎都会产生相同的结果(内置显示)。display 2将指外部显示。我有一个非常简单的装置,所以取决于你的,你可能要做实验。
发布于 2020-02-23 21:12:58
如果您想要将显示名称与其颜色配置文件匹配,获取显示名称是前Catalina系统中的主要问题,但是可以对system_profiler实用程序的结果进行按摩,以获得早期系统中的名称。一个小小的AppleScriptObjC就能得到剩下的:
use AppleScript version "2.4" -- Yosemite (10.10) or later
use framework "Foundation"
use scripting additions
on run -- example
set screenProfiles to ""
set theScreens to current application's NSScreen's screens
set displayNames to getDisplayNames(theScreens) -- handle older systems
repeat with i from 1 to (count theScreens)
set profile to localizedName of colorSpace of item i of theScreens
set displayName to item i of displayNames
set screenProfiles to screenProfiles & "Name: " & displayName & return & "Profile: " & profile & return & return
end repeat
display dialog screenProfiles with title "Screen Color Profiles"
end run
to getDisplayNames(screenList)
set theNames to {}
if (get system attribute "sys2") > 14 then -- 10.15 Catalina and later
repeat with screen in screenList
set end of theNames to localizedName of screen
end repeat
else -- munge system profiler data
set displayKey to "<key>_IODisplayEDID</key>"
set nameKey to "<key>_name</key>" & return & tab & tab & tab & tab & tab & tab & "<string>"
set displayInfo to do shell script "system_profiler -xml SPDisplaysDataType"
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}
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 theNames to text here thru (here + there - 1) of anItem
end repeat
end if
return theNames
end getDisplayNamesNSScreen文档讨论了列表中的主屏幕。
发布于 2021-05-04 07:49:35
我不是在这里建议或提出任何技术建议,因为我没有资格这样做,并对你们所做的工作印象深刻。
我理解windows (颜色管理)的方法是,虽然许多设备(包括纸张)的配置文件都保存在适当的文件夹中,但只有一个可以用作系统配置文件。对于监视器配置文件,只有在需要或需要系统配置文件时“设置”的配置文件。如果创建了一个新的监视器配置文件(通过校准),那么该系统配置文件将被替换。
https://stackoverflow.com/questions/60350804
复制相似问题