Jump to content

dfay

Member
  • Content Count

    873
  • Joined

  • Last visited

  • Days Won

    46

dfay last won the day on February 24

dfay had the most liked content!

7 Followers

About dfay

  • Rank
    Advanced Member

Contact Methods

  • Website URL
    http://dfay.fastmail.fm/alfred/

Profile Information

  • Interests
    see also https://github.com/derickfay - assorted small projects related to Keynote, BibDesk, Alfred, Taskpaper & more
    http://dfay.fastmail.fm/et/ - using Editorial with TaskPaper files
    http://dfay.fastmail.fm/bibdesk/ - BibDesk scripts and templates
    and a blast from the past: http://dfay.fastmail.fm/wordperfect - WordPerfect on the Mac

Recent Profile Visitors

10,270 profile views
  1. In case anyone is still using version 1.2 of this (like I was) it will work in Mojave with Word 2016 if you change the lines in the Applescript save as active document file format format document default file name thePDF to save as active document file format format PDF file name thePDF
  2. What happened to your Word to PDF converter?

  3. The issue is that the original post doesn’t say which workflow it refers to. It should be posted on the thread for that workflow. Then someone may be able to help with the specific case.
  4. Hmm I'd never noticed that but there's an easy fix - go into each of the Run Script objects and the Script Filter and uncheck Escaping....Brackets.
  5. Updated to v.1.2 - added first day of next month - added external triggers for M of next week and 1st of next month - updated so snippets will paste in Alfred (using the trick here: https://www.alfredforum.com/topic/11765-snippet-triggers-triggered-in-alfred-dont-paste-to-alfred/?tab=comments#comment-61652 )
  6. It would be great if the preferences search could (optionally) include the notes field of workflow objects. I have a lot of Hotkey triggers that call scripts, so there's no text that I could search for except the descriptions I've added to the objects. Here's an example of where this feature would be useful:
  7. I never needed this until now, but I'm thrilled to see there's a working Alfred-based solution
  8. I’d recommend sips https://robservatory.com/use-sips-to-quickly-easily-and-freely-convert-image-files/ See especially the last link there.
  9. No. I use Drafts for iOS for almost all the same custom web searches I have in Alfred, but there’s no direct equivalent.
  10. TextExpander (legacy) is what they renamed TE Touch to be. Here's the setup in Hazel: this assumes anything you don't want to sync is tagged notForTE Rule 1. for your Alfred snippets folder: Rule 2. (same location) with the embedded script set to the first line here (I also sync to Copied, but I'll just cover TE for now) -- replacing the squiggles with the correct path to the script below: AlftoTE.py you'll need to specify the TE group where you want the synced snippets to appear and add the uuid to the script. I just created a new TE group for sync purposes, then went to Settings.textexpandersettings > Show Package Contents and found the new group file there. The uuid is just the group file e.g. group_E65531A8-88BA-4619-B5D1-B954AC3DC0FF_4733813705.xml without the group_ at the beginning and the .xml at the end e.g. E65531A8-88BA-4619-B5D1-B954AC3DC0FF_4733813705 #!/usr/bin/python import argparse # from plistlib import readPlist, writePlist - no longer writing TE plists directly import json import os import uuid from datetime import datetime # UUID for target group for new snippets in TextExpander teTargetGroup = "your uuid goes here" def get_te(abbreviation=None, plain_text=None, label=None): return { 'abbreviation': abbreviation, 'abbreviationMode': 0, 'creationDate': datetime.now(), 'label': label, 'modificationDate': datetime.now(), 'plainText': plain_text, 'snippetType': 0, 'uuidString': str(uuid.uuid4()).upper() } def a2te_replacements(s): s['snippet']=s['snippet'].replace('{clipboard}','%clipboard') s['snippet']=s['snippet'].replace('{cursor}','%|') # in theory this should be extensible to handle date formats and date math... return s def transform(direction, source): if direction == 'AlftoTE': source = source['alfredsnippet'] source = a2te_replacements(source) return get_te(abbreviation=source['keyword'], plain_text=source['snippet'], label=source['name']) else: raise Exception('Unsupported direction') if __name__ == '__main__': parser = argparse.ArgumentParser(description='Alfred-Expander Sync') parser.add_argument('direction', choices=['AlftoTE'], default='AlftoTE') parser.add_argument('--alf', default=None, help='Alfred json snippet') args = parser.parse_args() source = args.alf with open(source, 'rb') as source_fp: source_json = json.load(source_fp) s = transform(args.direction, source_json) # use TE AppleScript rather than modify plist directly cmd = """osascript -e 'tell application "TextExpander" set g to every group whose ID is \"""" + teTargetGroup + """\" tell item 1 of g make new snippet with properties {plain text expansion:"""+"\""+s['plainText']+"\","+"abbreviation:"+"\""+s['abbreviation']+"\",label:\""+s['label']+"\"}"+""" end tell end tell'""" os.system(cmd) Incidentally the argument parser is completely unnecessary since there's only one option, but it's a legacy from having used this to get started: https://github.com/markphilpot/sync_expanders
  11. Or to continue with AS, look at the examples here: This is what I used to figure out how to do the recent folders and active folders scripts in And here's a solution for you: set theList to {"Red", "Green", "Blue"} # What next? -- import JSON library set workflowFolder to do shell script "pwd" set json to load script POSIX file (workflowFolder & "/json.scpt") -- Create and add items set theItems to {} repeat with i from 1 to count theList set end of theItems to json's createDictWith({{"title", (item i of theList) as text}, {"uid", i},{"arg", (item i of theList) as text}, {"subtitle", "Same Words " & (item i of theList) as text}}) end repeat -- Create root items object and encode to JSON set itemDict to json's createDict() itemDict's setkv("items", theItems) return json's encode(itemDict)
×
×
  • Create New...