Запуск следующего примера AppleScript кода в Редактор сценариев :
display notification "Body Text Line" with title "Title Text Line" subtitle "Subtitle Text Line"
Создает это уведомление:
Затем выполняется следующий пример AppleScript код в Редактор сценариев :
tell application "System Events"
tell application process "NotificationCenter"
get value of static text 1 of window 1
get value of static text 1 of scroll area 1 of window 1
get value of static text 2 of scroll area 1 of window 1
end tell
end tell
Показывает следующий вывод в панели Ответы Редактор сценариев :
tell application "System Events"
get value of static text 1 of window 1 of application process "NotificationCenter"
--> "Title Text Line"
get value of static text 1 of scroll area 1 of window 1 of application process "NotificationCenter"
--> "Subtitle Text Line"
get value of static text 2 of scroll area 1 of window 1 of application process "NotificationCenter"
--> "Body Text Line"
end tell
Как видите, это get value of static text 1 of scroll area 1 of window 1
, который возвращает субтитры .