RodgerWW Posted January 29, 2015 Share Posted January 29, 2015 (edited) DOWNLOAD: Yosemite GUI Mode Toggle Workflow With either a shortcut or hotkey you can toggle between normal and dark mode in Yosemite AND thanks to the recent Alfred update, the Alfred Theme! To make the workflow universal this switches between the Yosemite themes included with Alfred 2. To change to your own "Normal" and "Dark" Alfred themes, be sure to modify the script lines accordingly: For Normal Mode change the name: tell application "Alfred 2" to set theme "OS X Yosemite" For Dark Mode change the name: tell application "Alfred 2" to set theme "OS X Yosemite Dark" Edited November 18, 2016 by RodgerWW Updating Link cands, Subject22 and gammawert 3 Link to comment
roccitman Posted February 27, 2015 Share Posted February 27, 2015 Nice! I wonder if Alfred workflows can be automated. I'd like for this to turn on in the evening and off in the morning. Lazy and all, you know Link to comment
raguay.customct Posted February 28, 2015 Share Posted February 28, 2015 Nice! I wonder if Alfred workflows can be automated. I'd like for this to turn on in the evening and off in the morning. Lazy and all, you know Yep, check it out here: http://www.alfredforum.com/topic/5575-automatically-change-themes-at-sunrise-and-sunset/ It was in the theme section of the forums. I use it and it works great. Link to comment
roccitman Posted February 28, 2015 Share Posted February 28, 2015 Sweet! Thanks a ton! Link to comment
dfay Posted April 5, 2015 Share Posted April 5, 2015 Very nice. I started extending this beyond Yosemite and Alfred. Here's how I added the ability to switch taskpaper themes as well: 1. copy your current theme (found in ~/Library/Application Support/TaskPaper/Themes/ ) to a file called current.taskpapertheme 2. update the AppleScript in the workflow as follows (substituting your username and your theme names (for Helvetilight-my.taskpapertheme and Helvetidark-my.taskpapertheme) in the appropriate lines): try set guiMode to do shell script "defaults read -g AppleInterfaceStyle" tell application "System Events" tell appearance preferences to set dark mode to not dark mode end tell tell application "Alfred 2" to set theme "OS X Yosemite - larger type" do shell script "cd '/Users/yourusernamehere/Library/Application Support/TaskPaper/Themes'; cat Helvetilight-my.taskpapertheme > current.taskpapertheme" on error tell application "System Events" tell appearance preferences to set dark mode to not dark mode end tell tell application "Alfred 2" to set theme "OS X Yosemite Dark - larger type" do shell script "cd '/Users/yourusernamehere/Library/Application Support/TaskPaper/Themes'; cat Helvetidark-my.taskpapertheme > current.taskpapertheme" end try 3. after you run the Alfred workflow, quit and restart Taskpaper. In theory, this could be done by AppleScript, but I didn't want to figure out how to check whether iit s already running, save open files, etc. Link to comment
wunderkidchaos Posted April 5, 2015 Share Posted April 5, 2015 Thanks, Rodger. This is just what I was looking for! Link to comment
dfay Posted June 21, 2015 Share Posted June 21, 2015 Also extensible for Byword by adding tell application process "Byword" to key code 53 using command down to each of the tell application "System Events" blocks Link to comment
dfay Posted August 1, 2016 Share Posted August 1, 2016 My latest updates for TaskPaper 3 and OmniFocus: do shell script "cd '/Users/username/Library/Application Support/TaskPaper/'; cat day.less > theme.less" tell application "OmniFocus" set value of preference id "OFIColorPaletteIdentifier" to "builtin:OmniFocus Light" end tell Same code but with night.less and OmniFocus Dark for night. You need to create a day.less and night.less TP3 theme. cands 1 Link to comment
dfay Posted July 23, 2018 Share Posted July 23, 2018 Latest addition using HazeOver -- which works great with everything else dark: tell application "HazeOver" set enabled to false end tell Link to comment
dfay Posted September 26, 2018 Share Posted September 26, 2018 For OmniFocus 3: day: tell application "OmniFocus" set value of preference id "OFIColorPaletteIdentifier" to "default" end tell night: tell application "OmniFocus" set value of preference id "OFIColorPaletteIdentifier" to "builtin:20-Dark" end tell Link to comment
sirshanksalot Posted October 6, 2018 Share Posted October 6, 2018 (edited) Great stuff @dfay! Note that it's not necessary to hardcode in hacks for these apps that now support Dark Mode natively: * Things 3.7 * OmniFocus 3.1 * TaskPaper 3.8 * HazeOver 1.8 * Ulysses 14 Hopefully all other apps worth their salt ASAP! However, I must say conflicting times, and I personally want on a per app basis, the abililty to control Dark Mode theme support. So I may be returning to your script enhancements to override the other way soon! Edited October 6, 2018 by sirshanksalot dfay 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now