Jump to content

Search the Community

Showing results for tags 'bash'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Alfred 3
  • Make the Most of Alfred
    • Discussion & Help
    • Bug Reports
    • Alfred Feature Suggestions
    • Themes
  • Alfred Workflows
    • Share your Workflows
    • Workflow Help & Questions
  • Alfred v2 Themes
  • Alfred Remote for iOS
    • Alfred Remote Discussion & Help
    • Remote Connection Troubleshooting

Categories

  • Articles
    • Forum Integration
    • Frontpage
  • Pages
  • Miscellaneous
    • Databases
    • Templates
    • Media

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Twitter


Website URL


Jabber


Location


Interests

  1. Hi, my first post is a little bit long, but I spent some days in Google before posting here, so I hope to get help. I am trying to create workflow using AppleScript that creates Mail message for me with some links in the footer of the mail body. The problem is that I can't insert links this way, because it places this html as Plain text instead of Rich text: set FooterText to "<a href=\"http://example.com\">Example link</a>" I was trying to find a way to convert html text to Rich text, and found that it can be done with "textutil" from a Terminal app. Running this command f
  2. Currently there are some issues with Run Script when using /usr/bin/php, /usr/bin/perl, /usr/bin/python, etc... Those processes are launched from the shell using certain environment variables (such as LANG=C or another non-unicode supporting environment) which disable features or environments we may need to run our scripts correctly. Currently the only solution to this would be to use /bin/bash or /bin/zsh and set things ourselves and then launch our script from there. Doing so means we sacrifice the convenience of having scripts right in the workflow visual themselves AND we can no l
  3. I'm trying to modify the AppendText2File workflow so that if the text to be appended has a single quote inside it the workflow doesn't break. Here's the relevant portion of the workflow: dt=`date` ## append to the original file echo "* "$dt" -- "{query} >> $original What do I do to strip out single quotes (or replace them with something bash/Alfred doesn't hate)?
  4. I would like to write an Alfred workflow that acts as a thin wrapper around a command line application which takes many option flags and arguments. Is there any way to integrate Alfred with the bash completion script of this application in such a way that the possible completions of a partially entered command are displayed?
  5. Hi All, I want to fire off MacVim with a keyword action and a shortcut for where to open MacVim, e.g.: mvim d -> open MacVim in the folder ~/Downloads mvim h -> open MacVim in the folder ~/ ... I wrote a case statement in bash like this: MVIM=/usr/local/bin/mvim case "{query}" in "h") cd ~/ && $MVIM ;; "d") cd ~/Downloads && $MVIM ;; *) echo "unknown directory specified" ;; esac And when I run (e.g., mvim d) it once works flawlessly. However, if I want to open a second window of MacVim by running e.g. 'mvim h' nothing happens until I close
  6. Hey everyone, here's one I can absolutely not figure out for myself: if have this very simple bash script called launcher.sh #!/bin/bash node="/usr/local/bin/node" ${node} test.js 127.0.0.1:8374 &> node-out.txt & and a quite simple node script called test.js require('easyimage').thumbnail({ src:"a.jpg", dst:"b.jpg", width:60, height:60 }).then( function(image) { console.log('success'); }, function (err) { console.log(err); }); If i call from the terminal node test.js or ./launcher.sh, then everything is fine (I get image a.jpg to be cropped and written to b.jpg)
  7. Hi all, I'm sure there's an easy answer to this, but could someone explain to me why a simple Keyword to Script workflow, consisting of a keyword foo and the following one-line bash script (where mate is the TextMate shell utility and bar is the absolute path to a text file) sudo mate bar does absolutely nothing, even though it works fine when I run it in Terminal,. This workflow used to work, but it hasn't for the past couple of months (I think, because I don't use it very often). It's not a huge deal, but I'd like to understand what's broken it. It's not because it's run with sudo,
  8. I have a need to have this snippet in my bash workflow: osascript <<EOT set myString to "This\\ is\\ string" return myString EOT It breaks with error: [ERROR: alfred.workflow.action.script] Code 1: 22:23: syntax error: Expected “"” but found unknown token. (-2741) I would like the output string to look like "This\ is\ string".
  9. Hi guys, I made BASH framework for Alfred that makes it easy to create a certain kind of workflow that allows you search and look up information without leaving the Alfred interface. It basically allows you to display results after selecting a result. It's a way around the fact that "Script Filters are the only way to pass feedback to Alfred" Here is an example. The magic happens at step 3. 1. Type in workflow keyword: 2. Type query to find results: 3. Selection of a result brings up additional results. There are two options for workflow creation: static, which i
  10. A simple workflow for managing casks. Download — stable version. The source code is available here: https://github.com/pstadler/alfred-cask
  11. Hi all, I've have some problems with determining the locals language in bash script in workflows in Alfred2. I'm on OSX 10.7.5 FR. My script : DATE=$(echo "{query}" | sed -e's/HAEC/CEST/g' -e's/HNEC/CET/g'); export LC_TIME="fr_FR.UTF-8"; date -jf "%d %B %Y %T %Z" "$DATE" "+%Y%m%d%H%M%S" I use it : Select a text date (i.e. : "18 décembre 2006 19:24:12 HNEC"), use my hotkey to launch Alfred2/Workflow/Bashscript Problem : Works • In Alfred2 when month has NO accented character (i.e. : "18 janvier 2006 19:24:12 HNEC") • In terminal as is with or without month with accented chara
  12. Hi guys, I made a workflow that checks to see if a specified website is online or offline. It uses the website "isup.me". The default trigger is "isd <URL>" Here's the github page: https://github.com/cheniel/Alfred-Site-Checker If you're just looking for the good stuff (immediate download): http://bit.ly/1evjqSu It's my first workflow, would definitely appreciate any comments or suggestions. Edit 4/10/14: fixed missing temporary folder bug.
  13. Hi Guys, I am having an issue with the following bash script: cd /Volumes/Development/RAGUSOURCE/highlander IFS=', ' read -a args <<< '{query}' case ${args[0]} in status) echo `vagrant status` ;; up) echo `vagrant up` ;; *) echo 'Usage highlander {status|up|halt|ssh}' exit 1 ;; esac The commands run fine via the terminal, but not in a workflow.
  14. My goal for my workflow is to run a bash command that uses ldapsearch to search my university's directory and return a list of contacts that operates similar to Alfred's contact search. I've got my bash script running fine, but I'm just unclear on how to format the returned information in the best way. Any guidance on script filtering and bash script returning would be great! I am relatively new at this, so excuse my poor terminology.
  15. I have a simple bash file to create a new markdown file named with the current date as well as the file name I input via {query} which works correctly... file="{query}".md touch ~/folder/_posts/$( date '+%Y-%m-%d-' )"$file" Is there an easy way to add code to replace spaces in the file name with dashes? Obviously, the date is formatted correctly. It would be so much easier to just type "this is the name of my file" versus "this-is-the-name-of-my-file". Also, how would I then have the file opened in my editor of choice? Usually the following works but for some reason is not. Probably t
  16. Hi all! So I'm finally getting around to doing my very own workflow programming and I've run into some weirdness creating a Workflow that Runs a Bash Script in Alfred v2. I've tested this bash script on the command line and it works a treat. In fact, most of the workflow works in Alfred but a couple of things are funky: When using \n inside my echo commands it literally prints \n instead of using a new line. I'd like to format my virtual hosts files as I have them now. It's even more critical for /etc/hosts where that needs to on a new line. When running the mysql logic - It doesn't cr
  17. Helps you lookup what shell commands mean using http://explainshell.com. Your OS X installation should have PHP 5.3.3 or newer installed. Lion or Mountain Lion should meet the minimum requirements. If not, you can install the latest version of PHP with MacPorts or Homebrew. Download! Requires Alfred 2 and the Powerpack. Updates can be found and installed using Monkey Patch, or the older Alleyoop (discontinued).
  18. A workflow for managing processes with top and kill. Use top to display the most active processes and kill to find and kill any running process by its PID or Name. Download — stable version. The source code is available here: https://github.com/pstadler/alfred-top
  19. I am working on a workflow which should execute a shell script command for of the documents (*.xml files) currently selected in the Finder. I did some experiments around it, but could not get it to work yet. Any pointers, e.g. what workflow elements I will need? I am currently thinking along the lines of first calling an applescript which gives me the selected files, then filtering out only the xml files and lastly calling a shell script for each of the files or alternatively calling the script once but passing along an array of xml files. What do you guys think? Thanks for any su
  20. I am trying to passing an argument from Alfred to a bash script run directly in Alfred. The script below works as intended if I run it in terminal. I also have run it in Alfred but have to manually setting the value of $STR to test2. If I set the value of STR in the script then the if statement runs as intended. If I comment out the variable with #STR the else statement runs as intended. How do I set the value of STR in alfred from the argument to Alfred. I have tried many iterations of {query} but none seem to work. Here is the Alfed version #!/bin/bash STR=test2 if [[ -n "$STR
  21. Hello, I hope my question is not yet asked somewhere else. So, I've just created a simple and straight forward workflow to make a folder tree. It works fine when interpreted in terminal, but in Alfred the tree is created into the workflow folder. I've seen here that the relative path is always the path trelative to the workflow folder. My question is probably noobish but… how can get the path of the folder I'm in at the time I launch Alfred to make my request ? Any hint would be appreciated.
  22. Hi folks, I manage to create the following script in php that's working. The aim is to extract and use multiple parameters from a single {query}. Here's a simplified example: $query = explode(' ', '{query}'); $elemA = $query[0]; $elemB = $query[1]; $elemC = $query[2]; echo "{$elemA}{$elemB}{$elemC}"; I would like to do the same in bash but cannot manage to get it work. Here's my try: This one is working outside Alfred, directly for my Terminal. Basically, it also automatically detect any space as a separator. query="{query}" i=1 for param in $query; do case $i in 1) elemA=$pa
  23. Hey Guys, I was playing around with the Script Filter XML a bit and now I have the following script, which does not work, but I cant tell why: cat << EOB echo "<?xml version='1.0'?>" echo "<items>" for line in $(gpg --list-keys | grep -E -o "\b[a-zA-Z0-9.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+\b") do echo "<item uid='$line' arg='$line'>" echo "<title>$line</title>" echo "</item>" done echo "</items>" EOB Strange thing is: When I execute the script in my bash an copy the output as xml in the ScriptFilter, everything works fine. I s
  24. I want to create a workflow that will take selected text in a document, add line numbers to it, and replace the selected text in the document. I created a workflow to be initiated by a hotkey when I have text selected but it doesn't work. I think that's mostly because I'm not much of a programmer and don't know how to work this thing very well. Download the workflow I created here. Any suggestions for how to make this work would be appreciated...
  25. In Alfred V1 w/ Powerpack I was able to run a bash script and assign a hot key to it. I don't see where I can do that with Workflows. Am I missing something?
×
×
  • Create New...