Skip to content

Commit

Permalink
Quick, write that down.
Browse files Browse the repository at this point in the history
  • Loading branch information
C. Thomas Bailey committed Jan 4, 2017
0 parents commit be92ffc
Show file tree
Hide file tree
Showing 12 changed files with 502 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
secrets.js
icons/*
!icons/readme.md
icon.png
16 changes: 16 additions & 0 deletions handle-action.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const alfy = require('alfy')
const open = require('open')
const notifier = require('node-notifier')
const { postCard } = require('./trello')

const input = JSON.parse(alfy.input)

const notify = (title, message) => notifier.notify({ title, message })

if (input.action === 'create') {
postCard(input.card)
.then(() => notify('It worked ⚡️', "Your card's now on Trello."))
.catch(reason => notify('Oops 🌧', `Hit a problem: ${reason}`))
} else if (input.action === 'show') {
open(input.url)
}
6 changes: 6 additions & 0 deletions icon-for.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = function iconFor (listName) {
const fileName = listName.toLowerCase().replace(' ', '_')
return {
path: `./icons/${fileName}.png`
}
}
1 change: 1 addition & 0 deletions icons/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Here is where you put `.png` files to use as icons for a list. For a list with the name *Music Practice*, you should put a file called `music_practice.png` in this directory.
8 changes: 8 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const alfy = require('alfy')

const userPermissionToken = alfy.config.get('userPermissionToken')
const developerKey = alfy.config.get('developerKey')
const boardId = alfy.config.get('boardId')

// TODO: finish this module. Should prompt user to provide userPermissionToken
// etc. if not present. Otherwise, should call show-lists module.
307 changes: 307 additions & 0 deletions info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,307 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>bundleid</key>
<string>io.noisemachines.write-that-down</string>
<key>category</key>
<string>Internet</string>
<key>connections</key>
<dict>
<key>218784CB-0933-4076-A2D6-5B9F64C4C1B5</key>
<array>
<dict>
<key>destinationuid</key>
<string>6AA671B5-1C8C-40F5-910B-7D2739C02571</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
</array>
<key>50B0CD10-4D52-4898-9C05-DD3A34A829C3</key>
<array>
<dict>
<key>destinationuid</key>
<string>EC0443C7-32F6-4FAE-91C5-3A9B951F4844</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
</array>
<key>6AA671B5-1C8C-40F5-910B-7D2739C02571</key>
<array>
<dict>
<key>destinationuid</key>
<string>8E5BF5DE-04C3-4A82-BEEA-2171544DCD70</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
</array>
<key>8E5BF5DE-04C3-4A82-BEEA-2171544DCD70</key>
<array>
<dict>
<key>destinationuid</key>
<string>DFEC23B9-8D16-4012-9434-3686421EBC43</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
</array>
<key>DFEC23B9-8D16-4012-9434-3686421EBC43</key>
<array/>
<key>EC0443C7-32F6-4FAE-91C5-3A9B951F4844</key>
<array>
<dict>
<key>destinationuid</key>
<string>218784CB-0933-4076-A2D6-5B9F64C4C1B5</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
</array>
</dict>
<key>createdby</key>
<string>C. Thomas Bailey</string>
<key>description</key>
<string>Interact with Trello inside Alfred</string>
<key>disabled</key>
<false/>
<key>name</key>
<string>Write That Down</string>
<key>objects</key>
<array>
<dict>
<key>config</key>
<dict>
<key>alfredfiltersresults</key>
<false/>
<key>argumenttype</key>
<integer>1</integer>
<key>escaping</key>
<integer>127</integer>
<key>keyword</key>
<string>show actions</string>
<key>queuedelaycustom</key>
<integer>3</integer>
<key>queuedelayimmediatelyinitially</key>
<false/>
<key>queuedelaymode</key>
<integer>1</integer>
<key>queuemode</key>
<integer>2</integer>
<key>runningsubtext</key>
<string>Thinking...</string>
<key>script</key>
<string>./node_modules/.bin/run-node show-actions.js "$1"</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
<string>test.sh</string>
<key>subtext</key>
<string></string>
<key>title</key>
<string>Find or create a card</string>
<key>type</key>
<integer>0</integer>
<key>withspace</key>
<true/>
</dict>
<key>type</key>
<string>alfred.workflow.input.scriptfilter</string>
<key>uid</key>
<string>6AA671B5-1C8C-40F5-910B-7D2739C02571</string>
<key>version</key>
<integer>2</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>alfredfiltersresults</key>
<true/>
<key>argumenttype</key>
<integer>1</integer>
<key>escaping</key>
<integer>127</integer>
<key>keyword</key>
<string>trello</string>
<key>queuedelaycustom</key>
<integer>1</integer>
<key>queuedelayimmediatelyinitially</key>
<false/>
<key>queuedelaymode</key>
<integer>0</integer>
<key>queuemode</key>
<integer>1</integer>
<key>runningsubtext</key>
<string>Thinking...</string>
<key>script</key>
<string>./node_modules/.bin/run-node show-lists.js "$1"</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
<string>test.sh</string>
<key>subtext</key>
<string>Work with Trello in Alfred</string>
<key>title</key>
<string>Write That Down</string>
<key>type</key>
<integer>0</integer>
<key>withspace</key>
<true/>
</dict>
<key>type</key>
<string>alfred.workflow.input.scriptfilter</string>
<key>uid</key>
<string>50B0CD10-4D52-4898-9C05-DD3A34A829C3</string>
<key>version</key>
<integer>2</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>concurrently</key>
<false/>
<key>escaping</key>
<integer>102</integer>
<key>script</key>
<string>./node_modules/.bin/run-node handle-action.js "$1"</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
<string></string>
<key>type</key>
<integer>0</integer>
</dict>
<key>type</key>
<string>alfred.workflow.action.script</string>
<key>uid</key>
<string>DFEC23B9-8D16-4012-9434-3686421EBC43</string>
<key>version</key>
<integer>2</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>argument</key>
<string>Selected a list.</string>
<key>cleardebuggertext</key>
<true/>
<key>processoutputs</key>
<true/>
</dict>
<key>type</key>
<string>alfred.workflow.utility.debug</string>
<key>uid</key>
<string>EC0443C7-32F6-4FAE-91C5-3A9B951F4844</string>
<key>version</key>
<integer>1</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>argument</key>
<string></string>
<key>variables</key>
<dict>
<key>listId</key>
<string>{query}</string>
</dict>
</dict>
<key>type</key>
<string>alfred.workflow.utility.argument</string>
<key>uid</key>
<string>218784CB-0933-4076-A2D6-5B9F64C4C1B5</string>
<key>version</key>
<integer>1</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>argument</key>
<string>Selected an action.</string>
<key>cleardebuggertext</key>
<false/>
<key>processoutputs</key>
<true/>
</dict>
<key>type</key>
<string>alfred.workflow.utility.debug</string>
<key>uid</key>
<string>8E5BF5DE-04C3-4A82-BEEA-2171544DCD70</string>
<key>version</key>
<integer>1</integer>
</dict>
</array>
<key>readme</key>
<string>Alfred's Script Filter object is extremely powerful, and gives you control over the results displayed in Alfred.
Alfred 3 now supports JSON, which is the recommended format. XML is also supported for legacy Alfred 2 workflows, and has been updated to include the new features.
A new option now exists for Script Filters, "Alfred filters results". This allows you to return a whole list of results, let Alfred do the subsequent filtering with extreme performance. When this option is selected, your script will be called once with no argument.</string>
<key>uidata</key>
<dict>
<key>218784CB-0933-4076-A2D6-5B9F64C4C1B5</key>
<dict>
<key>xpos</key>
<integer>300</integer>
<key>ypos</key>
<integer>200</integer>
</dict>
<key>50B0CD10-4D52-4898-9C05-DD3A34A829C3</key>
<dict>
<key>xpos</key>
<integer>60</integer>
<key>ypos</key>
<integer>170</integer>
</dict>
<key>6AA671B5-1C8C-40F5-910B-7D2739C02571</key>
<dict>
<key>xpos</key>
<integer>380</integer>
<key>ypos</key>
<integer>170</integer>
</dict>
<key>8E5BF5DE-04C3-4A82-BEEA-2171544DCD70</key>
<dict>
<key>xpos</key>
<integer>560</integer>
<key>ypos</key>
<integer>200</integer>
</dict>
<key>DFEC23B9-8D16-4012-9434-3686421EBC43</key>
<dict>
<key>xpos</key>
<integer>650</integer>
<key>ypos</key>
<integer>170</integer>
</dict>
<key>EC0443C7-32F6-4FAE-91C5-3A9B951F4844</key>
<dict>
<key>xpos</key>
<integer>230</integer>
<key>ypos</key>
<integer>200</integer>
</dict>
</dict>
<key>version</key>
<string>0.1</string>
<key>webaddress</key>
<string>https://github.com/noise-machines/write-that-down</string>
</dict>
</plist>
17 changes: 17 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "alfred-ideas",
"version": "0.0.1",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"alfy": "^0.3.0",
"node-notifier": "^4.6.1",
"node-trello": "^1.1.2",
"open": "0.0.5"
}
}
29 changes: 29 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Write That Down

*Write That Down* is an Alfred 3 workflow. It lets you interact with Trello right in Alfred. Perfect for jotting down quick ideas.

We're still in alpha, so documentation will be minimal. We'll add support for non-technical users in beta.

## Features

- For now, only supports interacting with a single board.
- Search all lists and cards in a board.
- Action a search result to open the card in your default web browser.
- When creating a new card, use `;` to separate the title from the card description. For example:
```
This is the title of my new card; this is the description.
```

## Limitations

**Connecting to Trello**

While in alpha, you'll have to set up the Trello API keys and whatnot yourself. Take a look at `trello.js` to see what information *Write That Down* requires.

**Setting up icons**

*Write That Down* can use specific icons for different lists. If you have a list named `Music Practice`, *Write That Down* will look for an icon at `./icons/music_practice.png`.

## License

[MIT](https://opensource.org/licenses/MIT) © 2017 [C. Thomas Bailey](https://github.com/noise-machines)
Loading

0 comments on commit be92ffc

Please sign in to comment.