Is it possible to get path to current display color profile using Applescript?
I assume it can be done via ColorSync, but I can’t find any reference of its commands, neither can I find suitable script in /Library/Scripts/ColorSync
BTW, Is there something like MSDN, but for Applescript? I mean, some set of documentation where all scriptable standard applications from MacOS are enumerated along with all their commands, properties, classes, etc.
Colorsync is scriptable, this is an example to change the profile of multiple displays
tell application "ColorSyncScripting"
launch
tell displays to set {cnt, dName, sProfiles} to {count it, name, display profile}
set allProfiles to name of profiles
end tell
repeat with i from 1 to cnt
set newProfile to choose from list allProfiles with prompt "Choose profile for display " & i default items (name of item i of sProfiles)
if newProfile is not false then
set newProfile to item 1 of newProfile
tell application "ColorSyncScripting" to set display profile of display i to profile newProfile
end if
end repeat
To gather the information about the scriptability of the applications, just load and read the dictionaries
tell application "ColorSyncScripting"
set alldisplays to every display
repeat with thedisplay in alldisplays
set profilepath to (location of display profile of thedisplay) as Unicode text
end repeat
end tell
If you need to study the available AppleScript dictionary of an application or scripting addition, then you can open their AppleScript libraries in Script Editor:
Script Editor > Window > Library
Or just drag an application icon of your choice onto Script Editor’s app icon to see its AppleScript dictionary.