Jump to content

hujhax

Member
  • Posts

    9
  • Joined

  • Last visited

  • Days Won

    2

hujhax last won the day on March 28 2015

hujhax had the most liked content!

hujhax's Achievements

Helping Hand

Helping Hand (3/5)

2

Reputation

  1. Hi all! I made a workflow for making changes in place to the selected text, via hotkeys. I demo the main behaviors in a screencast here. You can download this version of the workflow from dropbox here. (I'll get its github repository up to date shortly.) It requires python, but it's just using fairly standard modules: argparse, re, os, functools, and subprocess. Thanks for your help, everybody!
  2. Hi all -- I use Alfred on an iMac that has a Parallels VM installed. I have a bunch of hotkeys that should never, ever run when I'm using an app in Parallels. As far as I can tell, my only option is to take all of my apps in /<home>/Applications (Parallels) -- all 134 of them -- and drag them into the "Related Apps" dialog for each and every one of those hotkeys. Then, if I ever install a new application in my Parallels VM, I need to drag *that* to the "Related Apps" dialog for each of those hotkeys, too. Is there an easier way to do this? Specifically: 1. Is there any way to tell a hotkey "don't activate for any app in this subdirectory?" 2. Failing that, is there any way to tell Alfred about a group of applications, and then set individual hotkeys not to activate if any app in that group is active? Frankly, I'd even settle for "make it so *no hotkeys at all* activate for any app in the Parallels VM" if that would make things simpler. ~ thanks! ~ =-Peter -- peter rogers @ home | http://www.peterrogers.info "Love is like oxygen." Highly reactive, corrosive, and flammable. -- R. A. Porter
  3. Oh, and regarding ISO-8859-15, i just blindly copied that from an example here.
  4. That fixed it, thanks! The emended code: #!/usr/bin/python # -*- coding: utf-8 -*- import os import subprocess env = os.environ.copy() env['LC_CTYPE'] = 'UTF-8' p = subprocess.Popen(['pbcopy'], stdin=subprocess.PIPE, env=env) p.stdin.write("٭") p.stdin.close() p.wait() os.system("osascript -e 'tell application \"System Events\" to keystroke \"v\" using {command down}'")
  5. So I have this Python script: #!/usr/bin/python # -*- coding: iso-8859-15 -*- import os import subprocess p = subprocess.Popen(['pbcopy'], stdin=subprocess.PIPE) p.stdin.write("٭") p.stdin.close() p.wait() os.system("osascript -e 'tell application \"System Events\" to keystroke \"v\" using {command down}'") If I run that from the Terminal, it outputs the funky little star ("٭") to the console. I've tried putting that exact same Python script into a workflow, though, and using the hotkey only ever outputs "Ÿ≠" instead. What am I doing wrong? =-Peter -- peter rogers @ home | http://www.peterrogers.info When I was 23 myself, it amazed me that T.S. Eliot had written "The Love Song of J. Alfred Prufrock" at 23. Now it makes more sense to me, because of the refrain "There will be time..." Only a young person really believes that, I think. -- 'docbrite' on LiveJournal
  6. Thanks for your help, folks! Here's what I've got so far. It's a workflow that sets up lots of hotkeys for processing the selected text. So far I've got hotkeys for: *adding asterisk tags* (adding parens) _adding underscores_ interspersing-with-hyphens #makingahashtag TOGGLING CASE ... and shortening the selected URL.
  7. Awesome -- thanks for the info! I'll use that strategy in future. (Or actually I'll probably save off the clipboard, set the clipboard to some weird sentinel value, and *then* send the command-C, so I can verify that there's actually something selected.) ~ excelsior! ~ =-Peter
  8. Hmm -- except by the time I get to the script, my clipboard contents are already gone. If I put the contents of the clipboard into a variable, I'm just getting the current OSX selection.
  9. Hi all! -- This may be a dumb question. I am trying out Derick Fay's "case converter" workflow, and I noticed that if I selected (say) "foo" and uppercased it, then whatever I had on my clipboard got thrown out and changed to "foo". So I tried making this simple hotkey that wasn't hooked up to anything: http://screencast.com/t/HI2Y6JicAx And I noticed that this, too, was wiping out my clipboard. I have two questions about this: 1. Is there any way to pass the "Selection in OS X" to a script *without* obliterating the clipboard? 2. Failing that, is there some way to access the *original* clipboard contents in my script, so that I can put that back on the clipboard when I'm done? ~ thanks! ~ =-peter
×
×
  • Create New...