Skip to content

Instantly share code, notes, and snippets.

@alhafoudh
Created July 11, 2012 10:11
Show Gist options
  • Select an option

  • Save alhafoudh/3089432 to your computer and use it in GitHub Desktop.

Select an option

Save alhafoudh/3089432 to your computer and use it in GitHub Desktop.
OSX 10.8 Mountain Lion - Migrate your stickies from Stickies.app to Notes.app
# 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
@jlangvad
Copy link
Copy Markdown

jlangvad commented Aug 4, 2012

How do I use this?

@alhafoudh
Copy link
Copy Markdown
Author

alhafoudh commented Aug 4, 2012 via email

@athulss
Copy link
Copy Markdown

athulss commented Oct 26, 2015

Really useful script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment