-
-
Save jlangvad/3259840 to your computer and use it in GitHub Desktop.
OSX 10.8 Mountain Lion - Migrate your stickies from Stickies.app to Notes.app
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
# Author: Ahmed Al Hafoudh <alhafoudh@freevision.sk | |
# | |
# Usage: ruby stickies-to-notes.rb | |
# | |
# Prerequisites: | |
# gem install rb-appscript | |
# | |
require 'appscript' | |
require 'osax' | |
include Appscript | |
se = app('System Events') | |
stickies = app('Stickies') | |
notes = app('Notes') | |
se.application_processes['Stickies'].windows.get.each do |window| | |
note = window.scroll_areas.first.text_areas.first.value.get | |
notes.activate | |
OSAX.osax.set_the_clipboard_to(note) | |
se.keystroke('n', using: [:command_down]) | |
se.keystroke('v', using: [:command_down]) | |
sleep 0.5 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thks for this gist.
To make it work, I had to run Stickies and to check "activer l'accès pour les périphériques d'aide" in the system preferences.