programmmm
programmmm

Reputation: 19

Apple script notification

I need an applescript that sends a push notification, but when it sends one, i can find the notification only when i click on the notification center, but it doesnt "appere" in the upper right corner. Here is the code:

tell application "Finder" to activate
set inputVolume to input volume of (get volume settings)
if inputVolume = 0 then
    set inputVolume to 100
    display notification "unmuted" sound name "Frog"
else
    set inputVolume to 0
    display notification "muted"
end if
set volume input volume inputVolume

PS, The sound of the frog also doesnt work. Im happy with every advice of you!

Upvotes: 0

Views: 1525

Answers (1)

Robert Kniazidis
Robert Kniazidis

Reputation: 1878

Save your script as application, go to Notification Center settings, allow your application to send notifications (alerts). If you want to send notifications directly from the script editor, allow notifications for your script editor app instead.

I edited your script as well, because it contained errors.

set inputVolume to input volume of (get volume settings)

if inputVolume is missing value then return

if inputVolume = 0 then
    set volume input volume 100
    display notification "unmuted" sound name "Frog"
else
    set volume input volume 0
    display notification "muted"
end if

Upvotes: 1

Related Questions