Skip to content

Instantly share code, notes, and snippets.

@Zettt
Zettt / TextExpander to Text Shortcuts.applescript
Last active September 17, 2022 02:12
TextExpander Snippet to iOS/OS X Text Shortcuts. Read more: http://tmblr.co/ZFavEy-uZJ-M
set clickDelay to 0.3
set abbreviationList to {}
set snippetsList to {}
set disallowedGroups to {"AutoCorrect", "AutoCorrect Deutsch Snippets", "AlteNeue Rechtschreibung", "Deutsche Akronyme"}
set disallowedSnippetContents to {"%e", "%d", "%a", "%A", "%m", "%1m", "%b", "%B", "%y", "%Y", "%H", "%I", "%1H", "%1I", "%M", "%1M", "%S", "%1S", "%p", "%@+", "%@-", "%key:", "%clipboard", "%|", "%<", "%^", "%>", "%v", "%-", "%+", "%fill:", "%fillpart:", "%filltext:", "%fillpopup:", "%fillarea:"}
-- open the Text tab of Keyboard preferences
tell application "System Preferences"
activate
delay 5
tell application "Mail"
set _sel to get selection
set _links to {}
repeat with _msg in _sel
set _messageURL to "message://%3c" & _msg's message id & "%3e"
set end of _links to _messageURL
end repeat
set AppleScript's text item delimiters to return
set the clipboard to (_links as string)
end tell
@Zettt
Zettt / Cache Page.applescript
Created October 27, 2013 17:11
Script that uses frontmost tab and opens its Google Cache page. Wrote this while http://www.bishopfox.com/blog/2013/10/linkedin-intro/ was down.
set googleCacheURL to "http://webcache.googleusercontent.com/search?q=cache:"
tell application "Safari"
-- get url of frontmost tab
set safariWindow to first window
set originalURL to (URL of current tab of safariWindow) as text
--log originalURL
end tell
@Zettt
Zettt / Safari URLs List to OmniFocus.applescript
Last active December 26, 2015 16:19
Script to make a new inbox task in OmniFocus for frontmost Safari window and its open tabs.
(*
http://veritrope.com
Safari URLs List to OmniFocus
Version 1.0
April 23, 2011
Project Status, Latest Updates, and Comments Collected at:
http://veritrope.com/code/safari-tab-list-to-omnifocus
=========
BASED ON THIS SAFARI/EVERNOTE SCRIPT:
http://veritrope.com/code/export-all-safari-tabs-to-evernote/
@Zettt
Zettt / Move Mail Message Multiple Accounts.applescript
Last active December 8, 2023 23:16
AppleScript to move selected Mail messages to a particular mailbox of a particular account. User is asked only once. [This script](https://gist.github.com/Zettt/6551617) let's you choose an account first.
(*
Mail Filer
Files messages in Mail.app using type ahead. Displays one dialog containing all mailboxes and accounts.
Created by Andreas Zeitler on 2013-09-13
Copyright Mac OS X Screencasts 2013. All rights reserved.
*)
set myMailboxes to {}
@Zettt
Zettt / Move Mail Message Single Account.applescript
Last active March 16, 2016 15:00
AppleScript to move selected Mail messages to a particular mailbox of a particular account. User is asked two times, once for mailbox, once for account to move messages to. [This script](https://gist.github.com/Zettt/6551639) displays only on dialog.
(*
Mail Filer
Files messages in Mail.app using type ahead. Display a dialog for account and one for all mailboxes of that account.
Created by Andreas Zeitler on 2013-09-13
Copyright Mac OS X Screencasts 2013. All rights reserved.
*)
tell application "Mail"
-- choose account
@Zettt
Zettt / Open Tabs in Chrome.applescript
Created September 12, 2013 14:50
Script opens all tabs from frontmost Safari window in Google Chrome. Handy for "moving" accounts, e.g. moving likes, playlists, etc. from one YouTube channel to another.
tell application "Safari"
set urlList to ""
set tabcount to number of tabs in window 1
repeat with y from 1 to tabcount
set tabURL to URL of tab y of window 1
set urlList to urlList & tabURL & linefeed as string
tell application "Google Chrome" to open location tabURL
end repeat
@Zettt
Zettt / OpenMeta2OSXTags.sh
Last active May 5, 2021 15:58
Script that reads OpenMeta tags and writes them to OS X Mavericks tags. http://mosx.tumblr.com/post/54049528297/convert-openmeta-to-os-x-mavericks-tags-with-this This requires a OpenMeta binary to be installed. Change its path, if you prefer it to be somewhere else. For the files to be processed properly don't include a trailing slash in `$files…
# =============================================================
# = OpenMeta to OS X Tags =
# =============================================================
# Script to convert OpenMeta tags to OS X Mavericks tags.
#
# Created by Zettt (Andreas Zeitler) on 2013-06-28
# Source www.macosxscreencasts.com, mosx.tumblr.com
#
# OpenMeta to OS X Tags by Andreas Zeitler is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike
@Zettt
Zettt / List to Reminders.applescript
Created June 23, 2013 10:36
Script to put a list of text from your clipboard in Reminders. Inspiration drawn from Drafts' "List to Reminders" feature. More info: (not published yet)
-- get clipboard and separate lines
set clipboardText to the clipboard as text
set reminderLines to paragraphs of clipboardText
set defaultRemindersList to "Shoppinglist"
-- figure out if a non-default reminder list should be used
if item 1 of reminderLines starts with "!" then
-- set other reminder list and delete first line
set remindersList to characters 2 thru -1 of item 1 of reminderLines as text
set reminderLines to items 2 thru -1 of reminderLines
@Zettt
Zettt / Action.scpt
Last active December 18, 2015 05:48
Wrapper Plugin
set wrapStart to system attribute "KMPARAM_WrapStart" -- as Unicode text
set wraptext to system attribute "KMPARAM_Text" -- as Unicode text
set wrapEnd to system attribute "KMPARAM_WrapEnd" -- as Unicode text
return wrapStart & wraptext & wrapEnd