Commit 72560f88 authored by Jonas Neugebauer's avatar Jonas Neugebauer

Added 'frontmatter' to some scripts

parent 67350ae3
(*
name: Compose mail
apps: Airmail 2
description: Quickly compose an email in Airmail 2
parameters:
SUBJ: Subject line
SENDR: Sending account to use
RECEIPIENTS: List of recipient mails
CC: List of cc mails
BCC: List of bcc mails
TESNIP: Abbreviation of a TextExpander snippet to use as content
compile: false
*)
property SUBJ : ""
property SENDR : ""
property RECEIPIENTS : {""}
......@@ -17,12 +31,12 @@ tell application "Airmail 2"
repeat with B in BCC
make new bcc recipient at end of newMail's bcc recipients with properties {name:"", address:B}
end repeat
compose newMail
activate
if TESNIP is not "" then
delay 1
tell application "TextExpander" to expand abbreviation TESNIP
end if
end tell
\ No newline at end of file
end tell
(*
Use as a script in Airmail rules to save attachments to
folder DOWNLOADS.
name: Save attachments
apps: Airmail 2
description: Use as a script in Airmail rules to save attachments to the selected folder.
parameters:
DOWNLOADS: Folder to save attachments to
compile: false
*)
property DOWNLOADS : "/Volumes/Hyrrokkin/Downloads"
property DOWNLOADS : "~/Downloads"
on processMessage(theMessage)
try
......@@ -12,4 +16,4 @@ on processMessage(theMessage)
do shell script "cp " & thePDF & " " & DOWNLOADS
end tell
end try
end processMessage
\ No newline at end of file
end processMessage
(*
name: Set Caffeine state
apps: Caffeine, Alfred
description: Use as Alfred action to activate/deactibvate Caffeins or toggle the state.
parameters:
compile: false
*)
on alfred_script(q)
if q is not in {"toggle", "deactivate", "activate"} then
set q to "toggle"
......
(*
name: Show Caffeine state
apps: Caffeine, Alfred
description: Use in Alfred script filter to show Ceffeins state (active or inactive).
parameters:
compile: false
*)
set theState to "inactive."
tell application "Caffeine"
if active is true then
......
(*
name: Compose mail
apps: Mail
description: Quickly compose an email in Mail.app
parameters:
SUBJ: Subject line
SENDR: Sending account to use
RECEIPIENTS: List of recipient mails
CC: List of cc mails
BCC: List of bcc mails
TESNIP: Abbreviation of a TextExpander snippet to use as content
compile: false
*)
-- Subject line
property SUBJ : ""
-- Sending account to use. Needs to be in the format "Name <Mail>" and
......@@ -22,7 +36,7 @@ tell application "Mail"
end repeat
end tell
end if
set newMail to make new outgoing message with properties {subject:SUBJ, sender:SENDR, content:SNIP, visible:true}
repeat with R in RECEIPIENTS
make new to recipient at end of newMail's to recipients with properties {name:"", address:R}
......@@ -33,6 +47,6 @@ tell application "Mail"
repeat with B in BCC
make new bcc recipient at end of newMail's bcc recipients with properties {name:"", address:B}
end repeat
activate
end tell
\ No newline at end of file
end tell
(*
name: Save attachments
apps: Mail
description: Use as a script in Mail.app rules to save attachments to the selected folder.
parameters:
DOWNLOADS: Folder to save attachments to
TRASH_AFTER: Set to true to trash the mail after saving the attachments
compile: false
*)
(*
Saves the mail attachments to DOWNLOADS.
*)
......@@ -13,10 +23,10 @@ using terms from application "Mail"
repeat with aStuff in theStuff
save aStuff in POSIX file (DOWNLOADS & "/" & name of aStuff)
end repeat
if TRASH_AFTER then delete aMail
end try
end repeat
end tell
end perform mail action with messages
end using terms from
\ No newline at end of file
end using terms from
(*
name: Vacuum Mail.app index
apps: Mail
description: Speed up Mail.app by vacuuming the Envelope Index
parameters:
compile: true
*)
(*
Speed up Mail.app by vacuuming the Envelope Index
Code from: http://www.hawkwings.net/2007/03/03/scripts-to-automate-the-mailapp-envelope-speed-trick/
Originally by "pmbuko" with modifications by Romulo
Updated by Brett Terpstra 2012
Updated by Mathias Trnblom 2015 to support V3 in El Capitan and still keep backwards compability
Updated by Mathias Törnblom 2015 to support V3 in El Capitan and still keep backwards compability
*)
tell application "Mail" to quit
set os_version to do shell script "sw_vers -productVersion"
set mail_version to "V2"
considering numeric strings
if "10.10" os_version then set mail_version to "V3"
if "10.10" <= os_version then set mail_version to "V3"
end considering
set sizeBefore to do shell script "ls -lnah ~/Library/Mail/" & mail_version & "/MailData | grep -E 'Envelope Index$' | awk {'print $5'}"
......@@ -20,4 +28,4 @@ set sizeAfter to do shell script "ls -lnah ~/Library/Mail/" & mail_version & "/M
display dialog ("Mail index before: " & sizeBefore & return & "Mail index after: " & sizeAfter & return & return & "Enjoy the new speed!")
tell application "Mail" to activate
\ No newline at end of file
tell application "Mail" to activate
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment