GithubHelp home page GithubHelp logo

danieldiekmeier / textexpander-to-alfred3 Goto Github PK

View Code? Open in Web Editor NEW
62.0 7.0 1.0 17 KB

Convert your TextExpander snippets to Alfred 3 snippets.

License: ISC License

JavaScript 100.00%
textexpander snippets alfred textexpander-snippets

textexpander-to-alfred3's Introduction

TextExpander to Alfred 3

⚠️ Heads up ⚠️: I programmed this in April 2016. I then converted all my snippets, so I haven't needed this tool since. In the last years, both TextExpander and Alfred have released several new major versions, which may or may not work with this tool (Judging by the support requests I get, they don't!)

If this tool does not work, I can't help you. If you know Node.js, you may be able to fix it yourself and send a Pull Request to my respository. I will probably accept it!

Motivation

With TextExpander changing its business model, the new Alfred version supporting text replacement, and the general wish to use the smallest number of different apps, I wrote this script to convert the .textexpander files to .alfredsnippets files.

TextExpander uses a plist with all the entries in an array, and Alfred uses a ZIP file containing a JSON file for each snippet.

Usage

First, you'll have to export your TextExpander snippets. To do that, right click on a snippet folder and select Save a Copy of Group.

Then, you just have to run the program with the .textexpander file as the only argument. It will then put a .alfredsnippets file in your current working directory. Open that file with Alfred to load the snippets.

You could install the tool with npm install -g textexpander-to-alfred3, but you can also use npx to skip the permanent installation::

npx textexpander-to-alfred3 Signatures.textexpander
> Wrote file /Users/You/Signatures.alfredsnippets

NOTE: For some reason, TextExpander v3 does not export a snippet group's group-level prefix, so you will have to re-do that in Alfred once you import it.

textexpander-to-alfred3's People

Contributors

danieldiekmeier avatar matthewmcvickar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

guiluchesi

textexpander-to-alfred3's Issues

Web converter down

Thanks for this tool! Web converter says site can't be reached once upload is complete and Convert button is pushed.

Screen Shot 2019-11-23 at 10 00 45 PM

Information for newbies

Hi Daniel, can this (or something like it) be added to the readme? Might save some folks some time.

  • The script requires node.js from https://nodejs.org/en/
    -- After installing the package, open a Terminal window, and type the following command (you will be prompted for an admin users password - usually it's your normal password unless you are on a managed system, i.e. WORK): sudo npm install -g textexpander-to-alfred3

"Label" in TextExpander Not Maintained

Great script here. Just a heads up that the "Label" in TextExpander is not being maintained as far as I can see. It appears you're taking whatever the abbreviation was in TE and assigning it as the "Name" in Alfred. Labels from TE will be important to keep as Names in Alfred since you can search through snippets easily.

After import: https://www.dropbox.com/s/0plo21qw5qzyse4/Screenshot%202016-05-17%2020.48.24.png?dl=0
In TE: https://www.dropbox.com/s/9lr2a37mte71skk/Screenshot%202016-05-17%2020.48.55.png?dl=0

site upload not working

Hey.. not sure if you are still supporting the online version, but it throws an error when you attempt to upload.. just letting you know..

xmldom error

I followed that tutorial :
http://www.alfredforum.com/topic/8883-import-textexpander-snippets-into-alfred-v3/
but I got an error :

textexpander-to-alfred3 english.textexpander
[xmldom error]  invalid document source 
@#[line:0,col:undefined]
/usr/local/lib/node_modules/textexpander-to-alfred3/node_modules/plist/lib/parse.js:45
  if (doc.documentElement.nodeName !== 'plist') {
         ^

TypeError: Cannot read property 'documentElement' of undefined
    at Object.parse (/usr/local/lib/node_modules/textexpander-to-alfred3/node_modules/plist/lib/parse.js:45:10)
    at ReadFileContext.fs.readFile [as callback] (/usr/local/lib/node_modules/textexpander-to-alfred3/textexpander-to-alfred3.js:27:25)
    at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:359:13)
pro:textexpander-to-alfred3-master admi$ 

I tried to make a Gist (Im a newbie...)
fc608c7ef257826239ae2ffe6117f451-d873e389a92818c6b177b0a3d75dd256edffaafc.zip

Hope it helps.

Best Regards

Yves

Cannot read property 'slice' of undefined

Tried to run and get the following error:

te2a3 Mike.textexpander
/usr/local/lib/node_modules/textexpander-to-alfred3/textexpander-to-alfred3.js:26
const name = !snippet.label || snippet.label === '' ? snippet.abbreviation.slice(0, 10) : snippet.label
^

TypeError: Cannot read property 'slice' of undefined
at transformSnippet (/usr/local/lib/node_modules/textexpander-to-alfred3/textexpander-to-alfred3.js:26:78)
at Array.map ()
at textexpander2Alfred (/usr/local/lib/node_modules/textexpander-to-alfred3/textexpander-to-alfred3.js:71:6)
at /usr/local/lib/node_modules/textexpander-to-alfred3/textexpander-to-alfred3.js:55:21
at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61:3)

Problem with `sanitize-filename` package

There appears to be an issue with one of your dependencies.

❯ te2a3 Composers.textexpander
/usr/local/lib/node_modules/textexpander-to-alfred3/node_modules/sanitize-filename/index.js:41
    .replace(illegalRe, replacement)
     ^

TypeError: Cannot read property 'replace' of undefined
    at sanitize (/usr/local/lib/node_modules/textexpander-to-alfred3/node_modules/sanitize-filename/index.js:41:6)
    at module.exports (/usr/local/lib/node_modules/textexpander-to-alfred3/node_modules/sanitize-filename/index.js:51:16)
    at transformSnippet (/usr/local/lib/node_modules/textexpander-to-alfred3/textexpander-to-alfred3.js:29:15)
    at Array.map (<anonymous>)
    at textexpander2Alfred (/usr/local/lib/node_modules/textexpander-to-alfred3/textexpander-to-alfred3.js:71:6)
    at /usr/local/lib/node_modules/textexpander-to-alfred3/textexpander-to-alfred3.js:55:21
    at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:54:3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.