Jump to content

deanishe

Member
  • Posts

    8,759
  • Joined

  • Last visited

  • Days Won

    522

Everything posted by deanishe

  1. Jb_Bryant is having similar problems. It's an Apple utility choking on an Apple file … I'm looking into a workaround. Thanks for the feedback.
  2. You don't use on alfred_script(q) with /usr/bin/osascript, but "{query}", as with other script types. This works (with caveats—see below): property automatorExtension : "workflow" property applescriptExtension : "scpt" set filePath to "{query}" set theFile to POSIX file filePath as alias tell application "Finder" -- If the file is an Automator workflow if (the name extension of theFile is in the automatorExtension) then set workflowPath to theFile as text set quotedWorkflowPath to quoted form of (POSIX path of workflowPath) set command to "/usr/bin/automator " & quotedWorkflowPath set output to do shell script command else -- If the file is an AppleScript if (the name extension of theFile is in the applescriptExtension) then set theScript to theFile as alias try run script (theScript) on error _error display dialog _error end try else -- If not an Automation workflow or an AppleScript display dialog ¬ ¬ "The selected file is not an Automation workflow or an AppleScript" buttons ¬ {"Cancel", "OK"} cancel button "Cancel" default button "OK" giving up after 5 end if end if end tell But you have to set the escaping properly (yours was wrong): Finally, it's worth noting that not all AppleScripts end with .scpt. I save mine in plain text format, so they have the extension .applescript. Also, you don't need that section at the end showing an error if the file isn't an Automator workflow or an AppleScript: the file filter ensures that only files of that type get passed to the action.
  3. Hi guys, Love the proper icons, kopischke, but your workflow shows drives with no free space (e.g. mounted CDs) as 0% full instead of 100% full. Both workflows wrongly add 'b' (instead of 'B'). We're talking about megabytes, not megabits
  4. I can't see this ever happening. Alfred is extremely closely tied to OS X infrastructure, and leverages what OS X offers extremely effectively. There's just nothing cross-platform about Alfred. You could probably bundle Windows versions of Python and Ruby relatively easily, but beyond that it's not just a question of re-implementing every other aspect of Alfred for Windows, but also of re-implementing a whole lot of stuff Alfred gets from OS X largely for free. And many workflows just wouldn't work. Andrew would have to hire several developers to realise a Windows port. It's just not viable. Your best hope is probably to try and kick-start an open-source project to build an Alfred-like counterpart for Windows.
  5. This would definitely be a handy feature. It's something workflow authors have to implement over and over again, and there is little consistency between workflows. I'm all for features that save 100 workflow authors re-implementing the same basic, boilerplate functionality 500 times. I would prefer a third tab in the workflow dialog you get when you double-click a workflow. If a workflow requires settings, this would automatically be shown on installation. If settings are invalid or incomplete, workflows could return an error to Alfred when run, which would lead to the settings sheet being shown (with the error message). Such things (required settings, whether to sync them or not) would be specified in the info.plist. These settings could also be synced across machines along with the workflows (though this should be optional).
  6. Certainly, some workflows, like Florian's Disk Space one, could look super amazing if you could align and colourise the output. Still, colourisation is a huge can of worms when it comes to themes. What do you mean by "keystroke mnemonics"? Action descriptions (can) already appear in the subtitle when you hold down modifier keys.
  7. Big thumbs-up from me on those two. The expansion of the ~ is mildly jarring/distracting and takes up a lot of precious query field space. I'd personally like to see it expanded to ~/. What actually bugs me, however, is that I often hit backspace a couple too many times (because Alfred deletes the entire last path level on one backspace) and find myself a level or two further back up the file tree than I want to be. I clearly haven't quite got my head around the fact that I only need to hit backspace once even though I typed 3 or 4 letters and TAB to get to where I am. Using ~/ would stop me accidentally traversing to / or /Volumes or /Volumes/Users (worst case, I'm a ~ away from being back in ~/), but what I'd really, really love is if Alfred selected the section of the query that would be deleted on backspace. That would be 100% consistent with the normal behaviour of the backspace key, and thus in line with (non-Alfred-guru) user expectations. I dare say Andrew will correct me if I'm wrong, as he's spent a lot more time thinking about these things, but I don't really see a downside to that, and it would add consistency (wrt other apps) and useful feedback to Alfred. With regard to hints in the sidebar, a resounding "yes, please". As you say, many of Alfred's keyboard shortcuts are non-obvious, and I really feel I'm not getting anything like the mileage I could out of it because I just don't know a lot of them. I didn't even realise you could add multiple files to the buffer till I read your post. The question is now whether I'll remember all the ALT+? shortcuts when I come to try it.
  8. It's probably better to use Run Script + osascript as RunNSAppleScript will block Alfred till it's done. The reason your Alfred script isn't working is because your Finder script is passing a File/Folder object (alias?) to the script, but Alfred passes a text object (the file's POSIX path). You probably need to start your Alfred script with something like: set theFile to POSIX file q as alias
  9. Bit of a funny one this. Basically, I'm posting here because I've been trying to debug an error that some users are having with a workflow I made but I've reached a point where I can't go make any further progress without assistance from "on high". I verified both users were using the latest version of Alfred, and had them run the workflow's script in the Terminal (no errors) and send me the generated XML. I can feed the XML back into my Alfred and the results show up just fine. There are also no non-ASCII characters in the XML which might have caused text encoding issues. I have been entirely unable to replicate the problem. I'd be happy to provide the XML via a non-public channel. I realise that filing this as an Alfred bug is somewhat tenuous, but as noted, my Alfred install accepts the same output, so I've exhausted the possibilities open to me, and Andrew is the only person who could possibly provide more insight, as he's the only one who can see what Alfred's doing with workflow output it doesn't like.
  10. To enable Gmail, open it in Chrome and hit the overlapping squares icon in the location bar. With regard to the configuration problem, could you open the workflow directory in Terminal and run: python mailto.py client If you could PM me the output, I can try to fix it. If there is no output, run: python mailto.py logon Then once more: python mailto.py client And finally: python mailto.py openlog And PM me the contents of the log instead.
  11. Have you enabled Gmail as an email client yet? It won't work if you haven't done that. I'm afraid I can't replicate the mailtoclient error. What happens when you TAB on it?
  12. The problem is that even with 3+ character queries, search takes ~0.2 seconds, which I consider to be unacceptably slow. I imagine a lot of people have significantly more contacts than I do, too. At the moment I'm experimenting with re-writing the workflow in Objective-C to get full speed out of the native API. Unfortunately, it's still a lot slower than the current implementation and the search is far more rudimentary. Are there any volunteers who I could send a proof-of-concept version to, so they can confirm whether it works with Exchange contacts, too? The Apple API docs say: However, Jb_Bryant reported that his Exchange contacts were showing up in the Python version that uses the official API (via a bridge).
  13. I just downloaded the workflow myself using Safari and it installed just fine. Could you verify that you're downloading a file called "MailTo.alfredworkflow" that is 197 KB in size?
  14. Checking every result to see if its path starts with the path of an excluded folder or ends with an excluded extension is a very trivial operation. To add some actual numbers to the discussion, I benchmarked such a directory-blacklist filter on my ancient Mac Pro (this is running on one 2.8 GHz core): | No. of filters | Files filtered per second | | -------------- | ------------------------- | | 1 | 2611658 | | 5 | 949018 | | 10 | 535346 | | 20 | 283730 | | 50 | 118983 | | 100 | 61502 | Certainly, that might perceptibly affect performance if there were dozens of excludes, so add a warning. Let me choose my own performance/functionality trade-off. I'm a big boy Except, as noted in the OP, a whitelist-only approach is often a poor (or no) substitute for blacklisting. Even using file filters, the same applies. That doesn't help. You're talking about a different set of problems. Sure, sometimes you can get around the lack of blacklisting using whitelisting, but it's often not a satisfactory alternative. What if I want to search a dozen different kinds of documents, but ignore the 13th and 14th kind? Or 20 subdirectories, but not 21 and 22? That's a helluva lot of work to do with whitelists, and brittle: I'd have to remember to update my file filters every time I added a subdirectory or new kind of file. Even if it runs at half the speed the current system does, I don't care. I accept the trade-off. Please let me make that choice for myself.
  15. It should work as is. Does it show any options? Should look like this (before you hit ENTER).
  16. I'm afraid that's not possible, as it isn't supported by the mailto protocol the workflow uses. Some email clients enable you to specify a sender when called via AppleScript, but they don't provide a way to see which sender addresses they know about …
  17. Very nice. Wish I'd known about that a long time ago …
  18. Agreed. I'd like to see Alfred hold onto the last entered input for a number of seconds. 15–30 perhaps. Or even store a history of ~10 most recent entries.
  19. Err, that is a programmatic way … You mean an actual API? There isn't one, not for AppleScript. Quicksilver can do it because it's a Cocoa application. AppleScript can't. You need to call the Cocoa NSPerformService class, which could possibly be done via AppleScript using Automator Runner, thus.
  20. This should do the trick. Kinda. It assumes that the main menu (where the Services menu resides) has the same name as the application. This isn't true for Google Chrome, for example, so the script doesn't work with it. set theServiceName to "OmniFocus: New Inbox Task per Line" tell application "System Events" set appName to item 1 of (get name of processes whose frontmost is true) tell (process 1 where frontmost is true) tell menu bar 1 tell menu bar item appName tell menu appName tell menu item "Services" tell menu "Services" click menu item theServiceName end tell end tell end tell end tell end tell end tell end tell
  21. You can do (3) by selecting bash as the interpreter and using /usr/local/bin/ruby myscript.rb. I tend to do this in any case, even when I'm using the system installation 'cos I prefer to keep the code together in source files, not in info.plist. I don't think Alfred "blessing" the install of additional runtimes is a very good idea. It would either lead to a bloated Alfred install (it'd have to install its own private versions to prevent breaking folks' stuff) or, as Dan Palmer pointed out, 10+ MB workflows. There are already 7 options, and if you want to use a different runtime, you can do that today. There's no reason why someone couldn't make a "library" workflow that contains a node.js (or whatever) install and other workflows could use that via the bash option and ../node.js/node SuperCool.js.
  22. Could both of you possibly try a couple of test queries and email me the output (I'll PM you my email address)? I suspect it's an encoding issue with the XML output, but I can't reproduce the problem here and Alfred itself is no help in this regard because it just fails silently without saying what's wrong. You'll have to open the workflow directory in Terminal. Open Alfred's preferences, right-click the workflow and choose Open in Finder. Then open Terminal, type "cd " (that's "cd" plus a space), and drag the folder to the Terminal window. Hit ENTER. Then try a couple of queries: python smartfolders.py -f 'Name of smartfolder 1' > query1.xml python smartfolders.py -f 'Name of smartfolder 2' 'Partial name of file in that folder' > query2.xml Note the ' > query1.xml' at the end. This will save the script output to the named files. Could you then zip the two XML files and mail them to me?
  23. Fairly hefty update today. Any and all problems with Airmail should be things of the past.
  24. *bump* Another update. No new features as such, but now recognises which email client you're using (i.e. no need to set one in the workflow), and comes with fairly robust support for most of the popular Mac email clients. That is to say, no more problems with Airmail, MailMate or contacts with commas or diacritics in their names. If your email client of choice isn't listed in the OP and/or isn't working properly, please let me know. Obviously, that applies to problems with listed email clients, too
×
×
  • Create New...