This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Get the text from Safari | |
tell application "Safari" | |
set thePageText to text of document 1 | |
end tell | |
-- Split the text into paragraphs | |
set thePars to paragraphs of thePageText | |
-- Find all paragraphs matching the desired criteria | |
set theText to "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- "using terms from" is necessary to let AppleScript know that these event handlers are terminology that belongs to the Contacts app | |
using terms from application "Contacts" | |
-- This handler returns the Contacts property for which the plug-in should function | |
on action property | |
return "phone" | |
end action property | |
-- This handler returns the name of the plug-in to be displayed in the Contacts property popup menu | |
on action title |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- This handler is triggered by Automator. The input and parameters variables are populated by Automator. Input contains the selected text passed to the workflow for processing. | |
on run {input, parameters} | |
-- Make sure the input is a string | |
set theText to input as string | |
-- Determine the maximum length for each line. Note that some lines may be longer, if needed to prevent words from breaking | |
set theMaxLineLength to 42 | |
-- Determine the prefix for each line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Options to process a maximum number of messages | |
property limitMessageProcessing : true | |
property theMaxMessagesToProcess : 5 | |
-- The voice to use when speaking. This should be one of the voices in System Preferences > Dictation & Speech > Text to Speech | |
property theVoice : "Alex" | |
-- Tihs setting controls whether the script raises the volume to speak, if needed. | |
property raiseVolumeIfNeeded : true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Options to process a maximum number of messages | |
property limitMessageProcessing : true | |
property theMaxMessagesToProcess : 5 | |
-- The voice to use when speaking. This should be one of the voices in System Preferences > Dictation & Speech > Text to Speech | |
property theVoice : "Alex" | |
-- Tihs setting controls whether the script raises the volume to speak, if needed. | |
property raiseVolumeIfNeeded : true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- This property controls the calendar on which the event is added | |
set theCalendarName to "AppleScripts" | |
-- Prompt the user to select a script to attach to an event. This should be an application. | |
set theScriptToTrigger to choose file with prompt "Please select a saved AppleScript application to attach to an event:" of type "app" | |
-- Get the script's name | |
set theScriptToTriggerName to displayed name of (info for theScriptToTrigger) | |
-- Check for the existence of the target calendar, creating it if it doesn't already exist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- "using terms from" is necessary to let AppleScript know that these event handlers are terminology that belongs to the Contacts app. | |
using terms from application "Contacts" | |
-- This handler returns the Contacts property for which the plug-in should function. | |
on action property | |
return "phone" | |
end action property | |
-- This handler returns the name of the plug-in to be displayed in the Contacts property popup menu. | |
on action title |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- "using terms from" is necessary to let AppleScript know that these event handlers are terminology that belongs to the Contacts app. | |
using terms from application "Contacts" | |
-- This handler returns the Contacts property for which the plug-in should function. | |
on action property | |
return "email" | |
end action property | |
-- This handler returns the name of the plug-in to be displayed in the Contacts property popup menu. | |
on action title |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Prepare a name for the new note | |
set theNoteName to "OmniFocus Completed Task Report" | |
-- Prompt the user to choose a scope for the report | |
activate | |
set theReportScope to choose from list {"Today", "Yesterday", "This Week", "Last Week", "This Month"} default items {"Yesterday"} with prompt "Generate a report for:" with title "OmniFocus Completed Task Report" | |
if theReportScope = false then return | |
set theReportScope to item 1 of theReportScope | |
-- Calculate the task start and end dates, based on the specified scope |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
do shell script "defaults -currentHost write ~/Library/Preferences/ByHost/com.apple.notificationcenterui doNotDisturb -boolean false" | |
try | |
do shell script "defaults -currentHost delete ~/Library/Preferences/ByHost/com.apple.notificationcenterui doNotDisturbDate" | |
end try | |
do shell script "killall NotificationCenter" |