Jump to content

rice.shawn

Member
  • Posts

    973
  • Joined

  • Last visited

  • Days Won

    57

Reputation Activity

  1. Like
    rice.shawn got a reaction from poer in PHP: Remember to set time zone before use of strftime()   
    Whoops. That way won't work (tested it in the ubuntu shell and not the mac shell).
     
    This one will:
    date_default_timezone_set( str_replace( '/usr/share/zoneinfo/' , '' , readlink('/etc/localtime') ) );
  2. Like
    rice.shawn got a reaction from thec13 in Alfred Cron: Execute Scripts (and workflows) on Intervals [v1.1]   
    Quite a few people have asked for the ability to execute workflows at certain times. Well, here's (kind of) a solution.
     
    Alfred Cron (note: consider this workflow to be a 'beta' right now) with will run any bash command on any interval that you define. Now, this means that you can run any script of any kind (to run a python script, you'd just write: python "/path/to/script.py" 'args'). It also means that you can take advantage of the new External Triggers in Alfred. So, if you want to run a workflow in the background at a certain time, then you can as long as there is an External Trigger for that workflow.
     
    Fun idea: if you're decently good at scripting, then you can replace Hazel with this workflow.
     
    You can define cron jobs through a nifty little GUI box. Just, see it in action in the GIF below:

     
    More detailed documentation is available at http://shawnrice.github.io/alfred-cron.
     
    Download it from Packal.
     
    Note: Alfred Cron uses the Alfred Bundler framework, so when you first execute the workflow, it will take a moment to install the bundler, Pashua, BashWorkflowHandler, and Terminal Notifier. So, be patient at first. They need to download only once.
     
    Also, Alfred Cron makes use of Ctwise's brilliant SetupIconsForTheme, so the workflow will adjust to your Alfred whether it is light or dark.
  3. Like
    rice.shawn got a reaction from frankspin in Alfred Cron: Execute Scripts (and workflows) on Intervals [v1.1]   
    Quite a few people have asked for the ability to execute workflows at certain times. Well, here's (kind of) a solution.
     
    Alfred Cron (note: consider this workflow to be a 'beta' right now) with will run any bash command on any interval that you define. Now, this means that you can run any script of any kind (to run a python script, you'd just write: python "/path/to/script.py" 'args'). It also means that you can take advantage of the new External Triggers in Alfred. So, if you want to run a workflow in the background at a certain time, then you can as long as there is an External Trigger for that workflow.
     
    Fun idea: if you're decently good at scripting, then you can replace Hazel with this workflow.
     
    You can define cron jobs through a nifty little GUI box. Just, see it in action in the GIF below:

     
    More detailed documentation is available at http://shawnrice.github.io/alfred-cron.
     
    Download it from Packal.
     
    Note: Alfred Cron uses the Alfred Bundler framework, so when you first execute the workflow, it will take a moment to install the bundler, Pashua, BashWorkflowHandler, and Terminal Notifier. So, be patient at first. They need to download only once.
     
    Also, Alfred Cron makes use of Ctwise's brilliant SetupIconsForTheme, so the workflow will adjust to your Alfred whether it is light or dark.
  4. Like
    rice.shawn got a reaction from homever in Yet another window layout workflow   
    If you read further up in the thread, you'll notice that the workflow author hasn't really been around, and, so, unless he shows back up, it's best to think of this amazing workflow as abandonware, meaning that feature requests won't happen.
  5. Like
    rice.shawn got a reaction from hpiwzqda in Caffeinate Control v 3 Released   
    Update: rewrote the entire thing as a bash script. It's much faster now. All the links are the same. Grab it if you want. Let me know if there are any bugs. (I couldn't find any).
     
    Caffeinate Control v2 v3
     
    I just pushed a major update to my old Caffeinate workflow, and I figured I'd just start a new thread. It is a complete overhaul. Find version 2 3 on Packal.org: packal page. 
     
    Option Configuration
     
    You can configure how you want Caffeinate to work for you. Do you want to keep the system awake? Just the display? Everything? Just type "caff configure" (or "caff c"), and you can set the options easily. If you want to change how it works later, then just run the config again. Change however frequent you want!
     
    Defaults
     
    We default to "i" or just to keep the system from idling (which lets you display turn off). Just run the config and choose more options to as you please. Multiple options are available by pressing cmd while clicking.
     
    Commands
     
    Just type "caff" to get started. It will tell you the status and give you the most relevant option first.     Example Arguments "caff e" enables caffeinate indefinitely "caff d" disables caffeinate "caff 15 2" enables caffeinate for 15 hours and 2 minutes "caff 23" enables caffeinate for 23 minutes "caff 2h" enables caffeinate for 2 hours "caff configure" opens the configuration dialog "caff help" opens the help dialog. Here are some screenshots:
     
    Shows the status left in hours / minutes, depending on how much time is left. You can also see the configure and help entries in the bottom. I need to get around to uninstalling caffeine because I don't use it anymore.
     

     
    Configure the behavior of how you want it to sleep. Just select the options and press "Set Options".
     

     
    If you input one number, it defaults to minutes. If you put in two numbers, it interprets as hours and minutes.
     

     
    You can specify with arguments too. Feel free to type out the whole words "hours" or "minutes" or whatever part of them you want to.
     

     
    Here's the help, explaining it a tiny bit more. Click on "More Info..." to be taken to the caffeinate man page.
     

     
    If you get really excited about typing a lot of minutes, then we'll still let you know how many hours that is... 
     

     
     
    (edited to add more pretty screenshots.)
  6. Like
    rice.shawn got a reaction from Cassady in Workflows Help Workflow   
    Okay, so I have a very rough and temporary version to download if you want something on Yosemite for now: https://github.com/shawnrice/alfred2-workflow-help/raw/master/whw.alfredworkflow. It uses a different bundleid, so it's not going to officially "replace" the old one yet. I still have a lot of work to do on it, so, when it gets to a better state, then I'll update it on Packal and post again here.
     
    Right now, it only opens the help file in a browser window, and it doesn't cache anything. Some of the formatting is a tiny bit funky as well. I'll add in more options later.
     
    But, right now, you have a nice scrolling nav window on the left, and you also have a great "filter" search box up top. It displays hotkeys as well.
     
    I just wanted to push this draft code so that people can use it again.
     
    Oh, and the code is an absolute mess. Don't judge me on it.
  7. Like
    rice.shawn got a reaction from Myo Myint Aung in Packal: Workflow and Theme Repository   
    I'm happy to announce that after months of development, I'm ready to make a new workflow and theme repository available to the public as an open beta: Packal. Workflows and themes are taggable and searchable. You can add in the icons, screenshots, long descriptions, and brief ones. There are many different ways to find whatever you need there. Since this is an initial announcement, there isn't much content there yet, except for the workflows and themes that a few kind testers uploaded.
     
    Themes are stored as a simple application URL, which means there are no files to download, but, instead, they import directly into Alfred2. Workflows are scanned for viruses after they are submitted but before they are made available publicly. Workflow authors can easily update their workflows just by editing the page and replacing the workflow file there.
     
    What is even better is that Packal has its own updater for workflows. So, you have the option to update any workflows that you have downloaded from Packal.
     
    I think that these are exciting developments for Alfred, and this sort of repository is what many people have been waiting for since these forums were created.
     
    One great advantage for distributing your workflows via Packal is that you do not need to maintain your own download links for your workflows anymore, so you won't need to worry about download limits on sharing services. Another advantage is that it will receive more visibility as it is a place where people can look for workflows and themes without having to page through the impressive number of posts in these forums.
     
    So, please, head over to Packal, browse what's there, and, very importantly, submit your own workflows and themes.
     
    --Shawn
  8. Like
    rice.shawn got a reaction from Cassady in Workflows Help Workflow   
    I think that you're right that Yosemite broke it. I just tried it on mine, and — lo and behold — it didn't work. I have been tinkering around with code (off and on) to update this thing, but I haven't been satisfied enough to finish any approach that I've taken. However, now that it's broken, fixing it has a bit more exigence. I have a few pressing deadlines in the next few days, but I'll try to fix it after that.
  9. Like
    rice.shawn got a reaction from frankspin in [Request] Slack Workflow   
    It looks like Frank posted the workflow on Packal, which means that you can easily get updates if you re-download the workflow from Packal, and then use the Packal Updater, which can update any workflow downloaded from Packal. It's the easiest way to keep your workflows updated.
  10. Like
    rice.shawn reacted to Andrew in Yosemite-esque Cards   
    I have some pretty special ideas for the future of Alfred and how things are displayed, so stay tuned
  11. Like
    rice.shawn got a reaction from vdesabou in Yosemite-esque Cards   
    First, I'll say that I'm not sure how feasible this would be, but...
     
    I really like how the new Spotlight shows the list of results to the left and a quicklook/card to the right. I can see this being very useful in script filters. Unfortunately, I don't think it would be possible to implement wholesale across Alfred. But we could, in a script filter, indicate that a card show be shown (this would be a global for the script filter) and then describe the content in the "card" for each result. I'm not sure if that would mean that we'd have the option to use quicklook for a document or render a map or just have some structured text appear, or a mix of both, but, regardless, it would be hella useful. Like, for the Spotify workflows, it could show the cover and some more meta-data about the track. For a translation workflow, it could show an extended translation or some synonyms or something. Some of this might be possible if the card field was just wrapped in a CDATA tag.
  12. Like
    rice.shawn got a reaction from rigrassm in Google Translate (Languages Configurable)   
    Note: the original version of this workflow utilized an unofficial API that Google Translate exposed. Unfortunately, the Google has shut down the API. There is an alternative workflow that uses the official (paid) Google Translate API that you can find here: http://www.packal.org/workflow/translate-api. It's actually pretty cheap. 
     
    Here's a little ditty that interfaces with Google Translate. The upside of this one is that it gives you access to all of Google Translate's languages (or at least about 80 of them). You can enable/disable languages from inside the workflow.
     
    Find it on Packal.
     
    Demo:
     

     
     
    Current Languages:
    Afrikaans Albanian Arabic Armenian Azerbaljani Basque Belarusian Bengali Bosnian Brazilian Portuguese Bulgarian Catalan Cebuano Chinese Croatian Czech Danish Dutch English Esperanto Estonian Filipino Finnish French Galician Georgian German Greek Gujarati Hatian Creole Hausa Hebrew Hindi Hmong Hungarian Icelandic Igbo Indonesian Irish Italian Japanese Javanese Kannada Khmer Korean Lao Latin Latvian Lithuanian Macedonian Malay Maltese Maori Marathi Mongolian Nepali Norwegian Persian Polish Portuguese Punjabi Romanian Russian Serbian Slovak Slovenian Somali Spanish Swahili Swedish Tamil Telugu Thai Turkish Ukranian Urdu Vietnamese Welsh Yiddish Yoruba Zulu
  13. Like
    rice.shawn got a reaction from judgejohn82 in REQUEST - Moreflicks Workflow   
    It would be hard.
     
    Moreflicks doesn't have an API (as far as I can tell), which means that, in order to interact with the website programmatically, someone would have to write a screen-scraper, which is usually a tedious task and is also fairly fragile because any change in the website's markup could break the screen-scraper. If you can find an API, then this is much more likely. You could also ask this guy if he could package the screen-scraping code that he wrote for the site. The other aspect is that it seems like creating such a tool would be against Moreflicks' Terms of Use.
  14. Like
    rice.shawn got a reaction from frankspin in Alfred/Workflows for teachers   
    If you're a big Evernote user, then Carlos's Evernote workflow can be of immense use. If your students turn in assignments electronically (and in terrible file formats), then you could use Pandoctor (an overlay of pandoc) to help you. If you're working with PDFs, then Skimmer might help you. If you need to convert units... If you need to keep your computer awake while you read... If you need to check percent changes...
     
    I'm sure there are others. What you could always do is identify tasks that you find yourself doing over and over that might require clicking or other tedious things, and you might be able to turn those into workflows.
  15. Like
    rice.shawn got a reaction from timmorrisdesign in Reveal current open Microsoft Word Document (2011 version) in Finder with HotKey   
    Use this as the applescript:
    on alfred_script(q) tell application "System Events" set frontApp to the name of the first application process whose frontmost is true if (frontApp is "Microsoft Word") then set continueProcess to true else set continueProcess to false end if end tell if continueProcess then tell application "Microsoft Word" to set documentName to path of active document as alias tell application "Finder" open the container of documentName activate select documentName end tell end if end alfred_script There's probably a more efficient way to do this, but this way works.
  16. Like
    rice.shawn got a reaction from timmorrisdesign in Reveal current open Microsoft Word Document (2011 version) in Finder with HotKey   
    It might be system dependent (I didn't really check that as much). I know that I got it to work on my machine.
     
    I got the actual string "Microsoft Word" by running an applescript from the script editor:
    delay 2 tell application "System Events" set frontApp to the name of the first application process whose frontmost is true return frontApp end tell For me, that returned "Microsoft Word"; if you run that same script, then it might be that the string returned is slightly different. Well, in that two seconds, I had to switch over to Word, but it worked then.
     
    You can get rid of this check and still have it be reliable by making the hotkey contextual to work only within Microsoft Word. To do this, double-click on the "hotkey" and press the "Related Apps" tab. Then add Microsoft Word.
      Another possibility is that it is opening the folder but not putting focus on it. Is that true?
  17. Like
    rice.shawn got a reaction from Ripcordian in Yosemite-esque Cards   
    First, I'll say that I'm not sure how feasible this would be, but...
     
    I really like how the new Spotlight shows the list of results to the left and a quicklook/card to the right. I can see this being very useful in script filters. Unfortunately, I don't think it would be possible to implement wholesale across Alfred. But we could, in a script filter, indicate that a card show be shown (this would be a global for the script filter) and then describe the content in the "card" for each result. I'm not sure if that would mean that we'd have the option to use quicklook for a document or render a map or just have some structured text appear, or a mix of both, but, regardless, it would be hella useful. Like, for the Spotify workflows, it could show the cover and some more meta-data about the track. For a translation workflow, it could show an extended translation or some synonyms or something. Some of this might be possible if the card field was just wrapped in a CDATA tag.
  18. Like
    rice.shawn got a reaction from racoonlab in Google Translate (Languages Configurable)   
    For future reference, the settings for the languages chosen are kept in the workflow's data directory. All the workflows should be storing data in
    ~/Library/Application Support/Alfred 2/Workflow Data/{workflow's-bundle-id}
  19. Like
    rice.shawn got a reaction from Carlos-Sz in JavaScript is the new automation language in Yosemite   
    Carlos, I think you're one of the only people who has convinced me that AppleScript is useful for more than one-liners.
     
    That being said, I still like late 90's grunge, which is awful.
  20. Like
    rice.shawn got a reaction from bencfd in Yosemite-esque Cards   
    First, I'll say that I'm not sure how feasible this would be, but...
     
    I really like how the new Spotlight shows the list of results to the left and a quicklook/card to the right. I can see this being very useful in script filters. Unfortunately, I don't think it would be possible to implement wholesale across Alfred. But we could, in a script filter, indicate that a card show be shown (this would be a global for the script filter) and then describe the content in the "card" for each result. I'm not sure if that would mean that we'd have the option to use quicklook for a document or render a map or just have some structured text appear, or a mix of both, but, regardless, it would be hella useful. Like, for the Spotify workflows, it could show the cover and some more meta-data about the track. For a translation workflow, it could show an extended translation or some synonyms or something. Some of this might be possible if the card field was just wrapped in a CDATA tag.
  21. Like
    rice.shawn got a reaction from Florian in Yosemite-esque Cards   
    First, I'll say that I'm not sure how feasible this would be, but...
     
    I really like how the new Spotlight shows the list of results to the left and a quicklook/card to the right. I can see this being very useful in script filters. Unfortunately, I don't think it would be possible to implement wholesale across Alfred. But we could, in a script filter, indicate that a card show be shown (this would be a global for the script filter) and then describe the content in the "card" for each result. I'm not sure if that would mean that we'd have the option to use quicklook for a document or render a map or just have some structured text appear, or a mix of both, but, regardless, it would be hella useful. Like, for the Spotify workflows, it could show the cover and some more meta-data about the track. For a translation workflow, it could show an extended translation or some synonyms or something. Some of this might be possible if the card field was just wrapped in a CDATA tag.
  22. Like
    rice.shawn reacted to Carlos-Sz in JavaScript is the new automation language in Yosemite   
    I really like AppleScript.
  23. Like
    rice.shawn reacted to deanishe in JavaScript is the new automation language in Yosemite   
    I really like 80's music. That doesn't mean it isn't awful…
  24. Like
    rice.shawn reacted to deanishe in JavaScript is the new automation language in Yosemite   
    Wouldn't have been my first (or even fourth) choice as a new scripting language of OS X, but it sure is a massive improvement on AppleScript.
     
    Man, I hate that language. This is one time I'll be happy to reimplement loads of my code in a new language.
  25. Like
    rice.shawn got a reaction from frankspin in Packal: Workflow and Theme Repository   
    I'm happy to announce that after months of development, I'm ready to make a new workflow and theme repository available to the public as an open beta: Packal. Workflows and themes are taggable and searchable. You can add in the icons, screenshots, long descriptions, and brief ones. There are many different ways to find whatever you need there. Since this is an initial announcement, there isn't much content there yet, except for the workflows and themes that a few kind testers uploaded.
     
    Themes are stored as a simple application URL, which means there are no files to download, but, instead, they import directly into Alfred2. Workflows are scanned for viruses after they are submitted but before they are made available publicly. Workflow authors can easily update their workflows just by editing the page and replacing the workflow file there.
     
    What is even better is that Packal has its own updater for workflows. So, you have the option to update any workflows that you have downloaded from Packal.
     
    I think that these are exciting developments for Alfred, and this sort of repository is what many people have been waiting for since these forums were created.
     
    One great advantage for distributing your workflows via Packal is that you do not need to maintain your own download links for your workflows anymore, so you won't need to worry about download limits on sharing services. Another advantage is that it will receive more visibility as it is a place where people can look for workflows and themes without having to page through the impressive number of posts in these forums.
     
    So, please, head over to Packal, browse what's there, and, very importantly, submit your own workflows and themes.
     
    --Shawn
×
×
  • Create New...