Skip to content

Commit

Permalink
Custom local screenshot folder (#4)
Browse files Browse the repository at this point in the history
* Custom local screenshot folder

* Updates screenshots added

* Update README.md
  • Loading branch information
vookimedlo authored May 1, 2018
1 parent 98a24c7 commit 82e9681
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 9 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ Screenshots files will be named according to the following pattern `screenshot_%
M Minutes, a number from 0 to 59.
S Seconds, a number from 0 to 59.

Default local screenshots folder `~/Desktop` can be changed by the workflow `DefaultLocalScreenshotFolder` variable.

![Alfre Variable Local](doc/images/alfred-various-screenshots-variable-local.png?raw=true "")

### Dropbox
There is no need to install a Dropbox software to your MacOS. The only requirement is to log into the [web Dropbox account][3] and create an access token for the workflow.

Expand Down
Binary file modified doc/images/alfred-various-screenshots-submenu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/images/alfred-various-screenshots-variable.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/images/alfred-various-screenshots.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 17 additions & 9 deletions src/info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,14 @@
<key>escaping</key>
<integer>127</integer>
<key>script</key>
<string>readonly filename=`date '+screenshot_%Y-%m-%d_%H-%M-%S.png'`
readonly filenamepath="$HOME/Desktop/$filename"
<string>DefaultLocalScreenshotFolder="${DefaultLocalScreenshotFolder:-$HOME/Desktop}"
# Expand ~, since it not works in Alfred
#
DefaultLocalScreenshotFolder=`echo "$DefaultLocalScreenshotFolder" | perl -pne 's/^~/$ENV{HOME}/'`
readonly filename=`date '+screenshot_%Y-%m-%d_%H-%M-%S.png'`
readonly filenamepath="$DefaultLocalScreenshotFolder/$filename"
if [ {query} = "area" ]; then
screencapture -is "$filenamepath" &gt;/dev/null 1&gt;&amp;2
Expand Down Expand Up @@ -294,7 +300,7 @@ fi</string>
<key>removeextension</key>
<false/>
<key>text</key>
<string>check your Desktop directory</string>
<string>check your {var:DefaultScreenshotLocalFolder} directory</string>
<key>title</key>
<string>Screenshot taken</string>
</dict>
Expand Down Expand Up @@ -353,19 +359,19 @@ fi</string>
<key>argumenttrimmode</key>
<integer>0</integer>
<key>argumenttype</key>
<integer>2</integer>
<integer>1</integer>
<key>fixedorder</key>
<false/>
<key>items</key>
<string>[{"title":"Screenshot - Area","arg":"area","subtitle":"Takes screenshot of selected area"},{"title":"Screenshot - Screen","arg":"screen","subtitle":"Takes screenshot of whole screen"},{"title":"Screenshot - Window","arg":"window","subtitle":"Takes screenshot of selected window"}]</string>
<key>runningsubtext</key>
<string></string>
<key>subtext</key>
<string></string>
<string>Takes screenshot</string>
<key>title</key>
<string>Area, Screen, Window</string>
<string>Various screenshots...</string>
<key>withspace</key>
<false/>
<true/>
</dict>
<key>type</key>
<string>alfred.workflow.input.listfilter</string>
Expand Down Expand Up @@ -813,7 +819,7 @@ fi</string>
<key>readme</key>
<string>See https://github.com/vookimedlo/alfred-various-screenshots
Icon taken from: https://openclipart.org/detail/809/computer-screen</string>
Icon taken from: https://openclipart.org/detail/301214/screenshot-icon-umber</string>
<key>uidata</key>
<dict>
<key>074744A2-8581-484C-B35D-A46DD0CD877B</key>
Expand Down Expand Up @@ -1035,6 +1041,8 @@ Icon taken from: https://openclipart.org/detail/809/computer-screen</string>
</dict>
<key>variables</key>
<dict>
<key>DefaultLocalScreenshotFolder</key>
<string>~/Desktop</string>
<key>DropboxAccessToken</key>
<string></string>
</dict>
Expand All @@ -1043,7 +1051,7 @@ Icon taken from: https://openclipart.org/detail/809/computer-screen</string>
<string>DropboxAccessToken</string>
</array>
<key>version</key>
<string>2017.12.02</string>
<string>2018.05.01</string>
<key>webaddress</key>
<string>https://github.com/vookimedlo/alfred-various-screenshots</string>
</dict>
Expand Down

0 comments on commit 82e9681

Please sign in to comment.