notifications to prowl (or growl)

joshualeeginsburg's icon

hi -

i want to be able to send push notifications to my iphone from max through prowl.
is there a way to do this from max?

thanks,

josh

earsmack's icon

Here is a script that I use to register itself with Growl and then send messages from iChat. Growl is then configured to send these to Prowl, which push to the iOS device. This works - all you have to do is tweak it to your specific need and get max to launch/execute it. Part of this came from an Apple example script.

(* INSTRUCTIONS
iChat includes the ability, within its preferences panel, to assign AppleScript scripts to a wide variety of iChat events. The following handler is called when a text invitation is received.
*)

tell application "GrowlHelperApp"
    -- Make a list of all the notification types that this script will ever send:
    set the allNotificationsList to ¬
        {"Initial Message Recieved", "Message Recieved"}

    -- Make a list of the notifications that will be enabled by default.
    -- Those not enabled by default can be enabled later in the 'Applications' tab of the growl prefpane.
    set the enabledNotificationsList to ¬
        {"Initial Message Recieved", "Message Recieved"}

    -- Register our script with growl.
    -- You can optionally (as here) set a default icon for this script's notifications.
    register as application ¬
        "iChatGrowlMe" all notifications allNotificationsList ¬
        default notifications enabledNotificationsList ¬
        icon of application "Script Editor"
end tell

using terms from application "iChat"
    on received text invitation this_message from this_buddy for this_chat
        set this_name to the name of this_buddy

        tell application "GrowlHelperApp"
            notify with name ¬
                "Initial Message Recieved" title ¬
                "Initial Message Recieved" description ¬
                this_name & ": " & this_message application name "iChatGrowlMe"
        end tell

        (*EXAMPLE: this routine automatically accepts a text chat invitation for specified buddies
        set this_name to the name of this_buddy
        if the name of this_buddy is in {"Johnny Appleseed"} then
            set the greeting_name to the first name of this_buddy
            if the greeting_name is "" then set the greeting_name to this_name
            accept this_chat
            send "Hello " & greeting_name & "!" to this_chat
        end if
        *)
    end received text invitation

    on message received this_message from this_buddy for this_chat
        set this_name to the name of this_buddy

        tell application "GrowlHelperApp"
            notify with name ¬
                "Message Recieved" title ¬
                "Message Recieved" description ¬
                this_name & ": " & this_message application name "iChatGrowlMe"
        end tell

        (*EXAMPLE: this routine automatically sends a random response to messages from specified buddies
        set this_name to the name of this_buddy
        if the name of this_buddy is in {"Johnny Appleseed"} then
            set canned_responses to {"Oh, I know!", "I was just thinking about that.", "Maybe tomorrow.", "Seems logical."}
            set this_response to some item of the canned_responses
            send this_response to this_chat
        end if
        *)
    end message received

end using terms from

earsmack's icon

So much for i before e except after c - just noticed some spelling errors but you get the idea.