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
-- This property controls whether full project paths (including parent folders) are displayed | |
property includeFullProjectPaths : true | |
-- These properties control whether additional task content is displayed | |
property includeTaskContext : true | |
property includeTaskEstimatedTime : true | |
property includeTaskStartDate : true | |
property includeTaskModificationDate : true | |
property includeTaskCompletionDate : true | |
property includeTaskNotes : 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
-- Ask the user to select an app | |
set theApp to choose file of type "app" default location (path to applications folder) | |
-- Get the app name | |
tell application "System Events" | |
set theAppName to name of theApp | |
if theAppName ends with ".app" then set theAppName to text 1 thru -5 of theAppName | |
-- Determine whether the app is a package, and notify the user if it's not | |
set isPackage to (package folder of theApp) |
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
-- 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
do shell script "defaults -currentHost write ~/Library/Preferences/ByHost/com.apple.notificationcenterui doNotDisturb -boolean true" | |
set theDate to quoted form of (do shell script "date -u +\"%Y-%m-%d %H:%M:%S +0000\"") | |
do shell script "defaults -currentHost write ~/Library/Preferences/ByHost/com.apple.notificationcenterui doNotDisturbDate -date " & theDate | |
do shell script "killall NotificationCenter" |
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" |
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
-- Find and replace a single word in an opened TextEdit document | |
tell application "TextEdit" | |
make new document | |
-- Add some text to the document | |
set text of front document to "The quick fox jumped over the lazy dog." | |
-- Find and replace | |
set every word of front document where it = "fox" to "elephant" | |
end tell |
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
tell application "Contacts" | |
set theSelection to selection | |
set thePerson to item 1 of theSelection | |
set theAddress to address 1 of thePerson | |
set theAddressText to formatted address of theAddress | |
end tell | |
set theDate to short date string of (current date) | |
tell application "Pages" |
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
--============================== | |
-- Send Keynote Presenter Notes to Evernote | |
-- Version 1.0.1 | |
-- Written By: Ben Waldie <[email protected]> | |
-- http://www.automatedworkflows.com | |
-- Version 1.0.0 - Initial release | |
-- Version 1.0.1 - Updated for Keynote 6.2 compatibility | |
--============================== |