Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no PHP version #3

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
composer.phar
/vendor/
.DS_Store
*.pyc
__pycache__
26 changes: 11 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
# Character & Word Counter for Alfred
An Alfred Workflow that count character & word for you
An Alfred Workflow that counts characters & words

## Screenshot
![Character & Word Counter Preview](preview.gif)
From [this](https://github.com/ibnuh/alfred-character-counter-workflow/releases/tag/1.0) workflow, minus PHP

<a href="https://github.com/giovannicoppola/alfred-character-counter/releases/latest/">
<img alt="Downloads"
src="https://img.shields.io/github/downloads/giovannicoppola/alfred-character-counter/total?color=purple&label=Downloads"><br/>
</a>

![demo](characterCountDemo.png)

## Installation
Download from [Release 1.0](https://github.com/ibnuh/alfred-character-counter-workflow/releases/tag/1.0)
Download the latest [release](https://github.com/giovannicoppola/alfred-character-counter/releases/latest/)

## Usage
Keyword: `cw`

## Development
```
Clone the repository
```

Open your favourite terminal

```
composer install
```

## Credits
1. Icons by [flaticon.com](https://www.flaticon.com/free-icon/alphabet-letters-a-b-and-c_27482)
2. PHP helper class for Alfred Workflows by [joetannenbaum/alfred-workflow](https://github.com/joetannenbaum/alfred-workflow)
2. [Original](https://github.com/ibnuh/alfred-character-counter-workflow/releases/tag/1.0)
Binary file added characterCountDemo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 0 additions & 5 deletions composer.json

This file was deleted.

57 changes: 0 additions & 57 deletions composer.lock

This file was deleted.

81 changes: 69 additions & 12 deletions info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<plist version="1.0">
<dict>
<key>bundleid</key>
<string>ibnuh.alfred.counter</string>
<string>giovanni-ibnuh.alfred.counter</string>
<key>category</key>
<string>Tools</string>
<key>connections</key>
<dict/>
<key>createdby</key>
<string>Muhammad Ibnuh</string>
<string>giovanni from Muhammad Ibnuh</string>
<key>description</key>
<string>An Alfred Workflow that counts character &amp; word for you</string>
<string>An Alfred Workflow to count characters &amp; words</string>
<key>disabled</key>
<false/>
<key>name</key>
Expand All @@ -25,14 +25,16 @@
<false/>
<key>alfredfiltersresultsmatchmode</key>
<integer>0</integer>
<key>argumenttreatemptyqueryasnil</key>
<false/>
<key>argumenttrimmode</key>
<integer>0</integer>
<key>argumenttype</key>
<integer>0</integer>
<key>escaping</key>
<integer>102</integer>
<key>keyword</key>
<string>cw</string>
<string>{var:mainkeyword}</string>
<key>queuedelaycustom</key>
<integer>1</integer>
<key>queuedelayimmediatelyinitially</key>
Expand All @@ -44,17 +46,43 @@
<key>runningsubtext</key>
<string>Counting "{query}"</string>
<key>script</key>
<string>php word.php "{query}"</string>
<string>#!/bin/zsh

myText=$1

myTextLength=$(echo -n "$myText" | wc -c)
myWordLength=$(echo -n "$myText" | wc -w)


cat &lt;&lt; EOB
{"items": [

{
"title": "character count: $myTextLength",
"subtitle": "$myText",
"arg": ""
},

{
"title": "word count: $myWordLength",
"subtitle": "$myText",
"arg": ""
}



]}
EOB</string>
<key>scriptargtype</key>
<integer>0</integer>
<integer>1</integer>
<key>scriptfile</key>
<string></string>
<key>subtext</key>
<string>Count "{query}"</string>
<key>title</key>
<string>Character &amp; Word Counter</string>
<key>type</key>
<integer>0</integer>
<integer>5</integer>
<key>withspace</key>
<true/>
</dict>
Expand All @@ -63,22 +91,51 @@
<key>uid</key>
<string>7547254A-2492-49D8-AF1C-EE388E43C92E</string>
<key>version</key>
<integer>2</integer>
<integer>3</integer>
</dict>
</array>
<key>readme</key>
<string></string>
<string>An Alfred Workflow to count characters &amp; words
https://github.com/giovannicoppola/alfred-character-counter</string>
<key>uidata</key>
<dict>
<key>7547254A-2492-49D8-AF1C-EE388E43C92E</key>
<dict>
<key>xpos</key>
<integer>310</integer>
<real>310</real>
<key>ypos</key>
<integer>110</integer>
<real>110</real>
</dict>
</dict>
<key>userconfigurationconfig</key>
<array>
<dict>
<key>config</key>
<dict>
<key>default</key>
<string>cw</string>
<key>placeholder</key>
<string></string>
<key>required</key>
<false/>
<key>trim</key>
<true/>
</dict>
<key>description</key>
<string></string>
<key>label</key>
<string>Keyword</string>
<key>type</key>
<string>textfield</string>
<key>variable</key>
<string>mainkeyword</string>
</dict>
</array>
<key>variablesdontexport</key>
<array/>
<key>version</key>
<string>0.2</string>
<key>webaddress</key>
<string>https://muhammadibnuh.com</string>
<string>https://github.com/giovannicoppola/alfred-character-counter</string>
</dict>
</plist>
Binary file not shown.
Binary file not shown.
24 changes: 0 additions & 24 deletions word.php

This file was deleted.