Jump to content

rice.shawn

Member
  • Posts

    973
  • Joined

  • Last visited

  • Days Won

    57

Everything posted by rice.shawn

  1. There are many of versions of this workflow in this thread: http://www.alfredforum.com/topic/710-toggle-caffeine/ Just cross-referencing them.
  2. There are many of versions of this workflow in this thread: http://www.alfredforum.com/topic/710-toggle-caffeine/ Just cross-referencing them.
  3. Thesaurus Workflow: You could always access the built-in dictionaries that the native Dictionary.app uses. They don't work with Applescript, so you can't use that. If you know ObjectiveC, then you could always write a quick utility (look up Dictionary Services). An alternative is to use Python. Poking around, I found this thread, which references a Python script that can poke through the dictionaries that are already there. The thread is a bit old, so I don't know if the Python utility still works. Also, someone might be able to port Alfred2's native "define" function to reference any of the Thesauruses that are pre-loaded on the Mac. Unfortunately, I don't know how to do any of the above, so I just instead offer the suggestion to use the built-in ones (which are pretty damn good) that will work offline. Shawn
  4. Yes! I found Bartender not too long ago. A few years ago, I had searched for a utility that would do the same thing, but none existed. I might have jumped up and down when I finally found Bartender a few months ago... Thanks for the tip.
  5. This is a great concept for repetitive tasks. I like the idea of working with Google Scholar to get a citation (I'd need to look into that a bit more), or it could be good to have it integrate with a Zotero database or a Papers2 database. GS would be good for general citations (here is a python parser: http://www.icir.org/christian/scholar.html), but GS' Terms of Use are a bit strange, and it looks like they might ban people for misuse (http://jacobjwalker.effectiveeducation.org/blog/2013/02/10/petition-to-open-google-scholar-to-automated-queries-and-release-its-api/). I'll try to look into this more. Thanks for the good idea.
  6. Updated the previous caffeinate workflow. I forgot to add in some flags (caffeinate is now activated with -dsi). The files at the previous links have been updated.
  7. Here is a more complex one that I did with "Caffeinate" (the 10.8 command utility, not the "Caffeine" app from Lighthead). Link: https://github.com/shawnrice/alfred-2-caffeinate-workflow/blob/master/Caffeinate.alfredworkflow The individual files are available at https://github.com/shawnrice/alfred-2-caffeinate-workflow/, just wander through the folders. Better explanations below. --- Caffeinate v Caffeine Caffeinate Pros: Caffeinate is already on Mountain Lion. With this workflow, you can operate it through just the keyboard. Cons: No visual status check to see if it's running. Only on 10.8. Caffeine Pros: Visual status (see coffee cup on menubar). Normally you have to use the mouse to activate (although toggles exist here). Available on more than just 10.8 Cons: Yet another app to install (although it is free). Yet more clutter in the menubar. --- What I did The scripts are written in php, and I set it up so that caffeinate takes these commands: * status — Shows whether caffeinate is active and returns the number of minutes if it is. * en — Enables caffeinate. * en "minutes" — Enables caffeinate for X minutes. * dis — Disables caffeinate. I divided it into three different php scripts. The first one takes the commands "help" or "Help" and also takes any command that isn't recognized. Then, the help display (which are the commands above) are displayed via Large Text. The second one is a status check that executes a few shell commands to see if caffeinate is active (using ps -ef and a regex), and, if it is, then it also pulls the command that launched caffeinate so that I can find whether or not there was an expiration time or if it was enabled indefinitely. The third one enables and disables the utility via the command line (again). Apparently, you can launch the process several times, and so I used a killall command to take them out on disabling them. If enabling, it checks to see if the utility is already running, if so, then it doesn't launch it again but reports that it is already running. Also, the status script and the en/dis script use the notification center to report back instead of Large Text. --- So, these scripts were thrown together quickly, but they might also be good for others to look at if they need some guidance working with php scripts or other arguments as I also tried to comment them a bit. They also show how to use system commands (especially backgrounding the caffeinate command) via php, which, of course, isn't always the best idea. And these scripts could also be written better, so keep that in mind. I'll say that I didn't like the Large Text to display the help function because I can't control the formatting well, but it seemed like the best option. The notification center cut off the text too quickly. Is there another way to display a quick help via Alfred when a command goes wrong? --- Screenshots: Launch Enable Status Help -- Shawn
  8. @loris — Good idea on the not needing to install git. Also, it might be easier to just keep the downloadable file as just the workflow file instead of a zip so that you don't clutter the downloads folder with .zips. Since the workflow files are usually pretty small, zipping isn't too necessary. @lazay — When I get some extra time, I'll write up a bit of documentation and post it here so that others can add/edit/remove before it goes on the site. It might also be great to list an alfred install command for the repository that would download the workflow directly to the alfred workflow folder so that users don't even need to move/clean the workflow files from the download folder. So, in the listing of the workflow in the repository there would just be a line that would read: "to install through the Alfred Package Manager, just type "apm install '<insert package name for each listing>' into Alfred if you have installed the Alfred Package Manager." Then just make sure that the last "Alfred Package Manager" is a link to the apm workflow extension's entry.
  9. From a blog post on OF2 that comes from the Omnigroup: So, they indicate that the regular version will leave out support for those things. Annoying.
  10. So, I'm sure that many users are going to go crazy installing any workflow that looks vaguely intriguing, and they're going to forget so many of the key words that they need to launch the workflows. Is there any way that we could get a command, like "help," that would show a list of the commands associated with the workflows? I realize that doing so might have to change a bit of the workflow infrastructure in that, perhaps, the keyword dialog might need to include a sort of "help" line. And arguments might need to be listed as well. I think I could do this with a workflow by creating something that would move through the workflow folders to parse the plist files, find which ones are enabled, and list the keywords maybe with the arguments, but it seems that this functionality should be in core, if possible. Thoughts?
  11. It seems that most every program has a context menu (the sort of ctrl+click or two finger click) that users expect to be there. Alfred2 doesn't have one in the workflow editor, but it could be good to add one that would at least pop up something like "Delete Item" or whatever else might be useful. If the context menu is called on a blank part of the canvas, then it could just replicate the function that the + button has.
  12. Could there be a thingie added for workflows that could be a sort of "first run..." sort of thing. So, instead of a hotkey, maybe there would be something that would be available so that there could be a disclaimer ("this workflow probably won't but may break your computer and cause armaggedon. If it does so, then the developers of Alfred and the particular workflow are not liable." Or it could take you through a series of commands that come with the workflow.
  13. Just a few more thoughts: It seems like it should be necessary to have a compatibility specification. This idea was prompted from the Caffeine Toggle thread when the command "caffeinate" came up that basically does the same thing as Caffeine but is native to OS X. Well, it's native to 10.8 and doesn't exist before 10.8, so it should be made known in any place that can be browsed that it won't work with anything earlier. Also, it might also be helpful to have as a requirement for listing the applications on which the workflows is based as well as a link to the app (maybe two different ones: one for the App Store and another for the developer's website, one of which would be necessary to have filled in just in case the app isn't in the app store or there isn't a developer site). I can easily imagine the scenario in which someone downloads the workflow for an app they don't have and are frustrated with the fact that the workflow doesn't work. I can also imagine the scenario in which someone is browsing the repository and doesn't know about an app and wants to learn more about it in a sort of way that browsing the workflows would lead to app discovery. It might be good to have a readme file included with each (maybe?) that could, optionally, be launched at first run. That might be able to have a nice disclaimer: "This may break your computer, probably not, but, if it happens to do so, it's not the developer's fault." Some sort of disclaimer might be good to have on the website as well. I have one reservation about having it so anyone can add a workflow via a github repository — what if they add things that aren't Alfred2 workflows? Or what if they add one that has a malicious script in it that can easily install some malware? With the Alfred2 workflows, it seems that it might be easy to do such a thing. I don't have a great idea on how to control for this right now, but it seems like it should be controled. Also, is it just GitHub? I don't think that doing so is necessarily a bad thing, and I understand that having a a source outside of GitHub would require much more coding for the website, but there should be some pretty good documentation (or at least pointing to a documentation) on the website for those who develop workflows but aren't familiar with GitHub. Thanks for putting more of this stuff together. It's pretty awesome.
  14. This sounds great. Can it add items to places other than the inbox? Can it add tasks without files? Can it add a task with a specific context and folder and project? This would be pretty great to expand to control Omnifocus completely. Maybe it could even add folders, projects, and contexts...
  15. I like the little icon to let me know, but I might be able to part with it. Remember, that the Ctrl+C hotkey can be avoided by making the process go into the background by just adding the "&" character afterward. So, if you want to run caffeinate in the background just type: caffeinate & Simple. There are many more options for caffeinate that can be found here: https://developer.apple.com/library/mac/#documentation/Darwin/Reference/Manpages/man8/caffeinate.8.html However, it seems to be lacking something like a status check. I'd like to be able to query caffienate to see if it's running, and, if it is, how much longer it will be on for. Although, I might be missing something obvious. Am I missing something obvious, anyone? When I get a bit of time, I'll try to write a bash script that will be able to convert times to seconds so that a user could write 1h and that would convert to 3600. I'll try to include other options like 1H or 1 H or 1 Hour or 2 Hours or even Two Hours, but the latter one might be harder. I can also include minutes in the script as well as seconds (although the seconds would be mostly useless, but it would help for usability in that people would expect it to be there). I'll even try to get it to recognize 2.5H and strings like 2 hours 15 minutes 34 seconds. This could be a useful script that could be used for many different workflows. But, before I spend some time working it out, does anyone already have a script that does what's outlined above? I'd rather not go around reinventing wheels.
  16. It also probably wouldn't be that hard to build a web site to browse the extensions once they're on github. If we standardize certain files that could be fed into the website, then it could just periodically query the main github repo to look for updates, pull the descriptor files, and update its own content. Since it would be periodic, then everything could be cached fairly easily, and it would be much easier for users to find the sorts of workflows that they want. If varnish is running in front of whatever system is working with github, and cloudflare is running in front of that, then it should be easy(ish) on the bandwidth for users to browse. That would also have the added benefit that developers of the workflows would control their content, so everyone, basically, maintains the site. So, I like the idea of github as the repo. The Alfred workflows that interface with the repo wouldn't have to send people to the github site (which turns off many non-developers), and then there is a nice showcase for people who want to look for them. Any critiques to the idea? Any suggestions on data structures? Shawn
  17. Here are two commands that might be able to help out here: List all the available networks: /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s Command to switch to a particular network in applescript: do shell script "/usr/sbin/networksetup -switchtolocation 'NETWORKNAME' "
  18. Update: In case anyone is reading this old thread, go ahead and look at the Caffeinate Control Workflow instead. Here's the forum link. --- Here's an applescript to toggle Caffeine. I'll setup a github repository for it later and post a link, but for now: tell application "Caffeine" if active then turn off set status to "deactivated." else turn on set status to "activated." end if set output to "Caffeine has been " & status return output end tell
  19. The Wifi Toggle Link is missing a hyphen. Here's the new one: https://github.com/aiyodk/Alfred-Extensions/raw/master/AlfredApp_2.x/Wi-Fi-Toggle/Wi-Fi-Toggle.alfredworkflow
  20. I'm using Mountain Lion (10.8.2), and the script was a bit dodgy for me. Apparently, sometimes 10.8 likes com.apple.finder and others com.apple.Finder I can't figure out a logic to but, here's a good way to alter filerevealer.sh in the package: #!/bin/bash visible="" flag="$(defaults read com.apple.Finder AppleShowAllFiles)" if [ $flag = "0" ]; then "$(defaults write com.apple.finder AppleShowAllFiles -bool true)" "$(defaults write com.apple.Finder AppleShowAllFiles -bool true)" visible="visible" elif [ $flag = "1" ]; then "$(defaults write com.apple.finder AppleShowAllFiles -bool false)" "$(defaults write com.apple.Finder AppleShowAllFiles -bool false)" visible="invisible" fi "$(killall Finder)" echo "Hidden files are now ${visible}."
×
×
  • Create New...