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 path to the Evernote templates folder | |
set theTemplatesFolder to (path to documents folder as string) & "Evernote Templates:" as alias | |
-- Retrieve a list of template file names without their .enex extensions | |
set theTemplateNames to list folder theTemplatesFolder without invisibles | |
repeat with a from 1 to length of theTemplateNames | |
set aTemplate to item a of theTemplateNames | |
if aTemplate contains ".enex" then set aTemplate to text 1 thru -6 of aTemplate | |
set item a of theTemplateNames to aTemplate | |
end repeat |
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 test folder | |
set theRootFolderName to "Cascade Windows Test" | |
-- Close any opened windows | |
tell application "Finder" | |
close every window | |
-- Locate the test folder, creating it if it doesn't exist | |
if folder theRootFolderName of desktop exists then | |
set theRootFolder to folder theRootFolderName of desktop |
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 enter some preliminary values for positioning and sizing the windows | |
set theTopOffset to askForInput("How many pixels would you like between the menu bar and the first window?", 10) | |
set theLeftOffset to askForInput("How many pixels would you like between the left of the screen and the first window?", 10) | |
set theWindowHeight to askForInput("How many pixels high would you like each window?", 300) | |
set theWindowWidth to askForInput("How many pixels wide would you like each window?", 350) | |
set theWindowOffset to askForInput("How many pixels would you like the windows offset from one another?", 25) | |
set staggerWindows to (button returned of (display dialog "Would you like the windows to cascade to the right?" buttons {"No", "Yes"} default button "Yes")) = "Yes" | |
-- Compensate for the menu bar | |
set theTopOffset to theTopOffset + 45 |
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
-- Make sure a presentation is opened in Keynote. If not, notify the user and stop. | |
tell application "Keynote" | |
if (front slideshow exists) = false then | |
display alert "Unable to proceed." message "Please open a presentation in Keynote." | |
return | |
end if | |
set extractBody to button returned of (display alert "Would you like to extract slide content too?" buttons {"Yes", "No"}) = "Yes" | |
-- Target the front presentation. |
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
-- Set up some initial starting positions and offsets | |
property theRaceStartingLineTopPosition : 50 | |
property theRaceStartingLineLeftPosition : 100 | |
property theRaceStartingLineBottomOffset : 200 | |
property theRaceFinishLineRightOffset : 200 | |
-- Determine the screen size | |
tell application "Finder" | |
set theDesktopBounds to bounds of window of desktop | |
set theDesktopWidth to item 3 of theDesktopBounds |
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 "OmniFocus" | |
-- Target the content of the front window | |
tell content of front window | |
-- Retrieve every selected task | |
set theTasks to value of every selected tree | |
-- Notify the user if no tasks are selected | |
if theTasks = {} then |
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
-- Set this property to the perspective you want to process | |
property thePerspectiveName : "Due" | |
-- Set up a variable for the task list text | |
set theTaskList to "" | |
-- Target OmniFocus | |
tell application "OmniFocus" | |
activate | |
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
set theDate to (current date) + 1 * days | |
repeat until weekday of theDate = Sunday | |
set theDate to theDate + 1 * days | |
end repeat | |
set theDate to year of theDate & "-" & (text -2 thru -1 of ("0" & (month of theDate as integer))) & "-" & (text -2 thru -1 of ("0" & (day of theDate as integer))) as string |
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
set theDate to (current date) | |
set theStartDate to theDate | |
repeat until weekday of theStartDate = Sunday | |
set theStartDate to theStartDate - 1 * days | |
end repeat | |
set theEndDate to theDate | |
repeat until weekday of theEndDate = Saturday | |
set theEndDate to theEndDate + 1 * days | |
end repeat | |
set theDate to (short date string of theStartDate) & " - " & (short date string of theEndDate) |
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
-- Receive images as input | |
on open theImages | |
-- Ask the user to specify a scaled image size | |
set theChoice to choose from list {"Low", "Medium", "High", "Custom"} default items {"Medium"} with title "Evernote > Scale Images Script" with prompt "Scale to what size?" | |
if theChoice = false then return | |
set theChoice to item 1 of theChoice | |
-- Set the maximum number of pixels accordingly, based on the specified scaled image size | |
if theChoice = "Low" then |
OlderNewer