![]() ![]() THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:ġ) Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.Ģ) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Nelson Elhage, Chris Nandor COPYRIGHT AND LICENSEĬopyright (C) 2004-2006 The Growl Project. The only case I've found where I need to use this is in X-Chat, where X-Chat dies when Foundation is loaded. The default is sensible in almost all cases. Note: You normally do not want to do this. Possible values for this var are, as described above: Foundation, Mac::Glue, Mac::OSA::Simple, MacPerl, Mac::AppleScript, and osascript. You can specify which architecture is used, by defining $Mac::Growl::base before loading the module, e.g.: BEGIN The methods should all function the same way, except that the various AppleScript methods (all except for Foundation and Mac::Glue) convert text to MacRoman instead of passing in UTF-8, and the Foundation method will send notifications to all logged-in users instead of just the current user. As a last resort, it will use osascript(1), a command line program that should be available on all Mac OS X machines. It tries various perl modules to accomplish this, in descending order of preference: Mac::Glue, Mac::OSA::Simple, MacPerl (which defines DoAppleScript), and Mac::AppleScript. If Foundation is not available (such as if you built your own version of perl), this module will attempt to talk to Growl using Apple events instead of the Cocoa API. This module is designed to use Foundation, a perl module included with Mac OS X that is probably only available if you are using the default system perl. If you have a string that is not in some representation other than "Perl's internal representation" - for example, maybe you have been passed a MacRoman string from another source - you can use Encode: require Encode Įncode::from_to($string, 'MacRoman', 'utf8') CAVEATS Architecture $string = Encode::encode('utf8', $string) This can usually be accomplished with utf8 or Encode, such as: use utf8 You must take responsibility to encode the characters properly yourself. Mac::Growl expects strings to be passed as UTF-8, if they have high-bit characters. It is specific to AppleScript, but the concepts apply to this module as well, except that file paths for images are Unix paths, not URLs. ![]() Also, optionally accepts a "sticky" flag, which, if true, will cause the notification to remain until dismissed, instead of timing out normally a "priority" value (range from -2 for low to 2 for high) and an image path, a path to a file containing the image for the notification.įor more information, see, which details how this all fits together. PostNotification takes the name of the sending application (normally the same as passed to the Register call), the name of the notification (should be one of the allNotification list passed to Register), and a title and description to be displayed by Growl. ![]() PostNotification(appname, name, title, description) Also, optionally accepts the name of an application whose icon to use by default. RegisterNotifications takes the name of the application sending notifications, as well as a reference to a list of all notifications the app sends out, and a reference to an array of all the notifications to be enabled by default. Mac::Growl defines two methods: RegisterNotifications(appname, allNotifications, defaultNotifications) Mac::Growl provides a simple notification for perl apps to register themselves with and send notifications to the Mac OS X notification application Growl. PostNotification("MyPerlApp", $notificationName, $notificationTitle, ![]() RegisterNotifications("MyPerlApp", $iconOfApp]) Mac::Growl - Perl module for registering and sending Growl Notifications on Mac OS X SYNOPSIS use Mac::Growl ':all' ![]()
0 Comments
Leave a Reply. |