Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save edersonbadeca/7fa093ee271fd902dd3ee43479ce5b4d to your computer and use it in GitHub Desktop.
Save edersonbadeca/7fa093ee271fd902dd3ee43479ce5b4d to your computer and use it in GitHub Desktop.
adjust-notification-center-position.scpt
tell application "System Events"
tell application process "NotificationCenter"
repeat while true
if exists window "Notification Center" then
try
repeat with theWindow in (get windows whose name is "Notification Center")
set displaySize to size of theWindow
set notifSize to size of UI element 1 of scroll area 1 of group 1 of theWindow
set currentPos to position of theWindow
set newPos to {-((first item of displaySize) - (first item of notifSize)) / 2, ((second item of displaySize) - (second item of notifSize) - 56)}
if currentPos ≠ newPos then
set position of theWindow to newPos
end if
end repeat
on error errMsg
log "Erro ao ajustar a janela: " & errMsg
end try
end if
delay 0.5
end repeat
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment