Notification Center offers another opportunity for providing feedback during script execution. Use the Standard Additions scripting addition’s display notification
command to show notifications, such as status updates as files are processed. Notifications are shown as alerts or banners, depending on the user’s settings in System Preferences > Notifications. See Figure 24-1 and Figure 24-2.
To show a notification, provide the display notification
command with a string to display. Optionally, provide values for the with title
, subtitle
, and sound name
parameters to provide additional information and an audible alert when the notification appears, as shown in Listing 24-1 and Listing 24-2.
APPLESCRIPT
Listing 24-1AppleScript: Displaying a notificationCheck your Mac OS Do Not Disturb settings. Click the three horizontal lines icon in the upper-right corner of your screen to open the Notification Center for Mac. Locate Do Not Disturb and make sure it’s toggled Off. Check your settings for Notifications & Actions. The system only dismisses the notification and launches your app if the user taps the app icon or sash, or if you explicitly call the notification controller’s perform Notification Default Action method. Group Notification Threads. The system groups related notifications together in the Notification Center.
display notification 'All graphics have been converted.' with title 'My Graphic Processing Script' subtitle 'Processing is complete.' sound name 'Frog'
JAVASCRIPT
Listing 24-2JavaScript: Displaying a notificationvar app = Application.currentApplication()
app.includeStandardAdditions = true
app.displayNotification('All graphics have been converted.', {
withTitle: 'My Graphic Processing Script',
subtitle: 'Processing is complete.',
soundName: 'Frog'
})
Note
AceMoney Lite also makes it easy to track your spending and investments, making it a reasonable financial tool for anyone looking to take control of their finances. That said, if you download statements from your online bank account, these can then be imported to saved time with manual entry. There's only support for two accounts in AceMoney Lite, but this should be enough for many people – and the full edition of the program is only $44.95 (around £30, AU$50) anyway. Mac finance software for budgets. You can even use the program to keep track of your PayPal account.Managing accounts in different currencies is no problem, but you'll have to enter data into this free personal finance software rather than having your transactions pulled in from your bank account. Cross-platformis simple enough to be used for home finances, but flexible enough to be put to use by small businesses as well.
After using a script to display a notification, the script or Script Editor (if the script is run from within Script Editor) is added to the list of notifying apps in System Preferences > Notifications. There, you can configure options, such as whether to display notifications as alerts or banners.
Clicking the Show button in an alert-style notification opens the app that displayed the notification. For a script app, the action of opening the app again triggers the run
handler of the script, potentially causing the script to begin processing a second time. Keep this in mind, and add code to your script to handle this scenario, if appropriate.
The Notification Center on your Mac is just as handy as the one on your iPhone or iPad. The Today View is perfect for those apps you use all the time like weather or a to-do list. The Notifications View lets you quickly glance at notifications you’ve received and missed.
You can easily forget that you have this convenient spot on your Mac. And at the same time, it can get so full that it’s just overwhelming to use. Customizing the Notification Center is key to making it work for you and here’s how to do it.
For more help with your Mac:
Contents
- 2 Customize the Notifications View Settings
- 3 Make the Notification Center Yours
Customize the Today View Settings
The apps in the Today View are easy to add and remove. Open your Notification Center by clicking the button on the top right of your menu bar. Click Today and at the bottom of the window, click Edit.
On the left, you’ll see the apps currently in your Today View and on the right, you’ll see others you can add.
- To remove an app from Today View, click the minus sign in red on the corner of the app. You’ll see it move from the left to the right.
- To add an app to Today View, click the plus sign in green next to the app. You’ll see it move from the left to the top on the right.
- To rearrange apps in Today View, select one, hold and drag it to its new position in the list, and release.
You’ll notice at the bottom of the editing window a button for App Store. If you click this, you’ll be taken right to the Mac App Store to a page with additional widgets you can download if you like.
After you finish removing, adding, or rearranging apps in Today View, click Done on the bottom left to close the editing window.
Customize the Notifications View Settings
Open your Notification Center by clicking the button on the top right of your menu bar. Click Notifications and at the bottom right of the window, click on the gear icon to open the settings.
When the pop-up window displays, you’ll see a list of all apps using notifications on your Mac. Showing some apps in your Notification Center makes sense like Reminders, Calendar, Mail, and Messages. But there are others that you probably don’t need notifications for such as Safari, Photos, Books, or Home.
This is all completely up to you, of course. Just remember that the point of the Notifications View is to see those alerts most important to you.
Notification Center Mac Shortcut
Remove Apps from the Notifications View
As you click each app on the left, you’ll see its settings on the right. Keep in mind that these are all of the notification settings for the app, there are only a couple that apply to the Notification Center. So, while you may remove apps from the Notification Center, you can still receive other alert types.
Select an app that you’d like to remove and on the right uncheck the box for Show in Notification Center.
Sort Apps in the Notification Center
Along with the ability to remove apps from the Notification Center, you can decide how the alerts are sorted.
At the bottom of the settings window, select the drop-down box for the Notification Center sort order. You have three options for sorting your alerts.
- Recents: Your notifications are sorted automatically according to the time they arrive with the most recent at the top.
- Recents by App: Your notifications are grouped by app and the app with the most recent notification is automatically listed first.
- Manually by App: Your notifications are grouped by app, similar to above, but are sorted by the order you select in the Notifications settings. Here’s how to use the Manually by App option.
Once you select that option for the sort order, you can move the apps in the list on the left.
- Select the app you want to move.
- Hold the app as you drag it to its new position.
- When you see the line showing where the app will fall, release.
- Now your apps will be sorted in your Notification Center in the order you want them.
Make the Notification Center Yours
With a few simple tweaks, you can have the Today and Notifications Views in the Notification Center show exactly what you want. It doesn’t take much time, isn’t a tedious task, and gives you the results that make the Notification Center work best for you.
Are you going to take a few minutes to customize your Mac Notification Center? Let us know how you like to arrange the views.
Sandy worked for many years in the IT industry as a project manager, department manager, and PMO Lead. She then decided to follow her dream and now writes about technology full-time. Sandy holds a Bachelors of Science in Information Technology.
Mac Notification Center Widgets
She loves technology– specifically – terrific games and apps for iOS, software that makes your life easier, and productivity tools that you can use every day, in both work and home environments.
Her articles have regularly been featured at MakeUseOf, iDownloadBlog and many other leading tech publications.