Jump to content

shortbread

Member
  • Posts

    5
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by shortbread

  1. oddly enough it's working fine now and I didn't change anything. Sorry for wasting your time !
  2. In the past I've been able to use the hotkey to toggle the visibility of Alfred. This has been handy as I've got the main hotkey mapped to my caps lock key via Karabiner. A single tap to make it show/hide is quite handy. Since updating to Mojave however I've noticed that the main hotkey only makes Alfred appear, but not go away. Not sure if this is a feature change or a bug, but thought I'd make a note of it. I've tested this with different hotkey combinations and with Karabiner completely unloaded to confirm it's unrelated to that. Alfred 3.7 macOS 10.14.1 has anyone else experienced this ?
  3. Thanks for putting this together! I came across a bug in getting this to work, and in fixing it wound up making some modifications ... Mainly I figured out how to extract the note contents from the sqlite db and add them to the JSON match field. The contents are gzipped in the db so I had to decompress and clean them up in order to use them for search matching ... I imagine performance could be a concern if you have a gajillion notes, but it runs very fast for me, pulling about 1000 notes down at a time. Modified python file contents are below - I made some other changes that may or may not interest you, but I can do a PR if you like. #!/usr/bin/python import sqlite3 import json import zlib import re # Open notes database home = '/'.join(__file__.split('/')[:3]) conn = sqlite3.connect( home + '/Library/Group Containers/group.com.apple.notes/NoteStore.sqlite') c = conn.cursor() # Get uuid string required in full id c.execute("SELECT z_uuid FROM z_metadata") uuid = str(c.fetchone()[0]) # Get tuples of note title, folder code, snippet, modification date, & id# # 432 is the zfolder id for 'Recently Deleted' c.execute("""SELECT t1.ztitle1,t1.zfolder,t1.zsnippet, t1.zmodificationdate1,t1.z_pk,t1.znotedata,t2.zdata,t2.z_pk FROM ziccloudsyncingobject AS t1 INNER JOIN zicnotedata AS t2 ON t1.znotedata = t2.z_pk WHERE t1.ztitle1 IS NOT NULL AND t1.zfolder IS NOT 432 AND t1.zmarkedfordeletion IS NOT 1""") matches = c.fetchall() # Sort by title matches = sorted(matches, key=lambda m: m[0], reverse=False) # Get ordered lists of folder codes and folder names c.execute("""SELECT z_pk,ztitle2 FROM ziccloudsyncingobject WHERE ztitle2 IS NOT NULL AND zmarkedfordeletion IS NOT 1""") folderCodes, folderNames = zip(*c.fetchall()) conn.close() # Alfred results: title = note title, arg = id to pass on, subtitle = folder name, match = the note contents items = [{"title": m[0], "arg": "x-coredata://" + uuid + "/ICNote/p" + str(m[4]), "subtitle": folderNames[folderCodes.index(m[1])], # + (" | " + m[2] if type(m[2]) is unicode and len(m[2]) > 0 else ""), # # decompress gzipped notes from the sqlite database, strip out gobbledygook footers. "match": zlib.decompress(m[6], 16+zlib.MAX_WBITS).split('\x1a\x10', 1)[0]} for m in matches] # Do further clean up and additions to the match and subtitle fields. for i, item in enumerate(items): # strip weird characters, title & weird header artifacts, # replace line breaks with spaces. txt = re.sub('^ ', '', re.sub('\n', ' ', re.sub('^.*\n', ' ', re.sub(r'[\x00-\x08\x0b\x0c\x0e-\x1f\x7f-\xff]', '', items[i]['match'])))) items[i]['match'] = items[i]['title'] + " " + items[i]['subtitle'] + " " + txt items[i]['subtitle'] += " | " + txt[:100] # Custom icons for folder names that start with corresponding emoji icons = [u'\ud83d\udcd3', u'\ud83d\udcd5', u'\ud83d\udcd7', u'\ud83d\udcd8', u'\ud83d\udcd9'] for i in items: if any(x in i['subtitle'] for x in icons): subtitle = i['subtitle'] icon = subtitle[:2] i['subtitle'] = subtitle[3:] i['icon'] = {'type': 'image', 'path': 'icons/' + icon.encode('raw_unicode_escape') + '.png'} output = {"items": items} print json.dumps(output, sort_keys=True, indent=4, separators=(',', ': '))
  4. I transcribed the shortcuts for Google Sheets, in case anyone wants them ! { "Google Sheets" : { "Select column" : "Ctrl + Space", "Select row" : "Shift + Space", "Select all" : "⌘ + a or ⌘ + Shift + Space", "Undo" : "⌘ + z", "Redo" : "⌘ + y or ⌘ + Shift + z or Fn + F4", "Find" : "⌘ + f", "Find and replace" : "⌘ + Shift + h", "Fill range" : "⌘ + Enter", "Fill down" : "⌘ + d", "Fill right" : "⌘ + r", "Save" : "⌘ + s", "Open" : "⌘ + o", "Print" : "⌘ + p", "Copy" : "⌘ + c", "Cut" : "⌘ + x", "Paste" : "⌘ + v", "Paste values only" : "⌘ + Shift + v", "Show common keyboard shortcuts" : "⌘ + /", "Compact controls" : "Ctrl + Shift + f", "Input tools on/off" : "⌘ + Shift + k", "Select input tools" : "⌘ + Option + Shift + k", "Bold" : "⌘ + b", "Underline" : "⌘ + u", "Italic" : "⌘ + i", "Strikethrough" : "Option + Shift + 5", "Center align" : "⌘ + Shift + e", "Left align" : "⌘ + Shift + l", "Right align" : "⌘ + Shift + r", "Apply top border" : "Option + Shift + 1", "Apply right border" : "Option + Shift + 2", "Apply bottom border" : "Option + Shift + 3", "Apply left border" : "Option + Shift + 4", "Remove borders" : "Option + Shift + 6", "Apply outer border" : "Option + Shift + 7 or ⌘ + Shift + 7", "Insert link" : "⌘ + k", "Insert time" : "⌘ + Shift + ;", "Insert date" : "⌘ + ;", "Insert date and time" : "⌘ + Option + Shift + ;", "Format as decimal" : "Ctrl + Shift + 1", "Format as time" : "Ctrl + Shift + 2", "Format as date" : "Ctrl + Shift + 3", "Format as currency" : "Ctrl + Shift + 4", "Format as percentage" : "Ctrl + Shift + 5", "Format as exponent" : "Ctrl + Shift + 6", "Clear formatting" : "⌘ + \\", "Move to beginning of row" : "Fn + Left arrow", "Move to beginning of sheet" : "⌘ + Fn + Left arrow", "Move to end of row" : "Fn + Right arrow", "Move to end of sheet" : "⌘ + Fn + Right arrow", "Scroll to active cell" : "⌘ + Backspace", "Move to next sheet" : "⌘ + Shift + Fn + Down arrow", "Move to previous sheet" : "⌘ + Shift + Fn + Up arrow", "Display list of sheets" : "Option + Shift + k", "Open hyperlink" : "Option + Enter", "Open Explore" : "Option + Shift + x", "Move focus out of spreadsheet" : "Ctrl + ⌘ + Shift + m", "Move to quicksum (when a range of cells is selected)" : "Option + Shift + q", "Move focus to popup (for links, bookmarks, and images)" : "holding Ctrl + ⌘, press e then p", "Open drop-down menu on filtered cell" : "Ctrl + ⌘ + r", "Open revision history" : "⌘ + Option + Shift + h", "Open chat inside the spreadsheet" : "Shift + Esc", "Close drawing editor" : "⌘ + Esc or Shift + Esc", "Insert/edit note" : "Shift + F2", "Insert/edit comment" : "⌘ + Option + m", "Open comment discussion thread" : "⌘ + Option + Shift + a", "Enter current comment" : "holding Ctrl + ⌘, press e then c", "Move to next comment" : "holding Ctrl + ⌘, press n then c", "Move to previous comment" : "holding Ctrl + ⌘, press p then c", "File menu" : "Ctrl + Option + f", "Edit menu" : "Ctrl + Option + e", "View menu" : "Ctrl + Option + v", "Insert menu" : "Ctrl + Option + i", "Format menu" : "Ctrl + Option + o", "Data menu" : "Ctrl + Option + d", "Tools menu" : "Ctrl + Option + t", "Open insert menu" : "⌘ + Option + = (with cells selected)", "Open delete menu" : "⌘ + Option + - (with cells selected)", "Form menu" : "Ctrl + Option + m", "Add-ons menu" : "Ctrl + Option + n", "Help menu" : "Ctrl + Option + h", "Accessibility menu" : "Ctrl + Option + a", "Sheet menu (copy, delete, and other sheet actions)" : "Option + Shift + s", "Context menu" : "⌘ + Shift + \\", "Insert rows above" : "⌘ + Option + = (with rows selected) OR Ctrl + Option + i, then r", "Insert rows below" : "Ctrl + Option + i, then b", "Insert columns to the left" : "⌘ + Option + = (with columns selected) OR Ctrl + Option + i, then c", "Insert columns to the right" : "Ctrl + Option + i, then o", "Delete rows" : "⌘ + Option + - (with rows selected) OR Ctrl + Option + e, then d", "Delete columns" : "⌘ + Option + - (with columns selected) OR Ctrl + Option + e, then e", "Hide row" : "⌘ + Option + 9", "Hide column" : "⌘ + Option + 0", "Group rows or columns" : "Option + Shift + Right arrow", "Ungroup rows or columns" : "Option + Shift + Left arrow", "Expand grouped rows or columns" : "Option + Shift + Down arrow ", "Collapse grouped rows or columns" : "Option + Shift + Up arrow ", "Show all formulas" : "Ctrl + ~", "Insert array formula" : "⌘ + Shift + Enter", "Collapse an expanded array formula" : "⌘ + e", "Show/hide formula help (when entering a formula)" : "Shift + Fn + F1", "Full/compact formula help (when entering a formula)" : "Fn + F1", "Absolute/relative references (when entering a formula)" : "Fn + F4", "Toggle formula result previews (when entering a formula)" : "Fn + F9", "Resize formula bar (move up or down)" : "Ctrl + Option + Up and Ctrl + Option + Down", "Turn on screen reader support" : "⌘ + Option + z", "Read column" : "⌘ + Option + Shift + c", "Read row" : "⌘ + Option + Shift + r" } }
×
×
  • Create New...