Jump to content

Subject22

Member
  • Content Count

    171
  • Joined

  • Last visited

  • Days Won

    10

Everything posted by Subject22

  1. A quick little workflow for showing and hiding file extensions. The workflow works as a file action (one action for showing and one for hiding extensions) and as a keyboard shortcut (for toggling the visibility of the file extensions of the items selected in OS X). Download: Show/Hide File Extensions
  2. OK, obviously that's completely up to you :-) Would you mind giving me a hand modifying the workflow to behave the way I want it to? If you could perhaps point me in the right direction it could save me some time :-) You're completely right, it does! I have no idea how I got confused over that one. Must have thought I was doing one thing when I was in fact doing another. Sorry about that!
  3. Huh? Couldn't you just inspect the file path of each file passed in? If it contains /Dropbox then it's in the Dropbox folder already and you don't need to move or copy it. No scanning involved. EDIT: One other thing. What do you think about having the workflow provide direct links for image files? I never want this sort of page, I want this kind, to allow embedding in forums like these (and even for normal sharing, I'd rather distribute the direct link). The only difference between the former and the latter links is that "www.dropbox" becomes "dl.dropboxusercontent".
  4. Is there any chance you could modify this to not move/copy files if they're already located somewhere in /Dropbox? It doesn't really make sense to copy/move a file to /Dropbox/Public when it's already available for linking. Other than that this is awesome, thanks!
  5. So Alfred essentially replaces all instances of "q" with the string passed in from OS X? Is this something that happens as a sort of textual preprocessing? OK, guess I've just been spoiled by Python's string handling routines
  6. In answer to my own question, as I dislike having to enter a space character to have the workflow display any computed results I found a simple tweak to change this behaviour. Disclaimer: I've never so much as glanced at php before and the script is quite long so for all I know this will break the workflow in some way (though it seems to be working fine so far). Change line 130 in units_v2.php in the following manner. From: $this->spaced = (substr($q,-1)==' '); To: $this->spaced = true; #(substr($q,-1)==' '); Also, designandsuch, calculations involving femtometres and picometres give a formula not found error, though based on your comments in the script I'm sure you're aware of this. It's pretty easy to add support for them, so for anyone who's keen just insert this code at around line 412. It's well laid out and easy to understand. $pm_base = function($pm=0 ){ return $pm / 1000000000000;}; // m = pm / 10000000000 $base_pm = function($m=0 ){ return $m * 1000000000000;}; // pm = m * 10000000000 $fm_base = function($fm=0 ){ return $fm / 1000000000000000;}; // m = fm / 1000000000000000 $base_fm = function($m=0 ){ return $m * 1000000000000000;}; // fm = m * 1000000000000000 If you're still developing this then one feature that could be handy would be thousands separators (i.e.: 1,000 rather than 1000).
  7. Awesome, thanks to you all for clearing that up. I'm sort of picking up AppleScript as I go, learning bits and pieces as I need them and thus far I haven't needed to really know anything about handlers. Now I'm unclear as to how the 'query' variable (or whatever it happens to be named) makes its way into the script. alfred_script() is a function ("handler" in AppleScript parlance) but the variable passed to it appears to be uninitialised. If I did this in some other language it wouldn't work: def someFunction(someVariable): print "I'm doing something" someFunction(query) # query hasn't been initialised, so how can someFunction access it? Additionally, since the 'query' variable is passed to the alfred_script() handler how does the rest of the script end up having access to it? Why isn't this analogous to the following (incorrect) code? def someFunction(someVariable): print "I'm doing something" someFunction(query) print query # Again, the variable hasn't been initialised, how does print access it? EDIT: One other thing, is there some standard method of iterating over files passed into an Applescript with Alfred? The script gets a tab delimited string, so what's the neatest way of iterating over that string, converting each file path to a file that Applescript can work with? This is what I'm currently using and it's kind of nasty. set AppleScript's text item delimiters to " " set filePaths to text items of q repeat with filepath in filePaths set theFile to POSIX file filepath as alias #do stuff end repeat
  8. I'm trying to make a workflow which when invoked by a hotkey will hide the extensions of the files currently selected in OS X but I'm not too sure how Alfred's "Selection in OS X" hotkey action panel works and there seems to be dearth of documentation about it. What exactly does this action panel pass to a script (e.g.: a string)? What is the normal way of receiving this input in a script (e.g.: with "{query}" or with something else)? Does this behaviour vary between different types of scripts (i.e.: bash, AppleScript etc.)? I set up a simple workflow and found that return "{query}" posted a notification as expected when run from the Run Script action panel (with all delimiters unchecked) but not when run from the Run NSApplescript action panel (with the alfred_script(q) wrapper). Why is this? Is there anything else I should know about the "Selection in OS X" hotkey action panel?
  9. A bit of a late reply, but it really is excruciatingly easy to change the behaviour of that alternative workflow so that you don't need to type the Wikipedia language code. There are instructions in the first post of the thread and in the script filter itself. Just add your preferred language code to the last line of the filter. For English the line would look like this: python w.py en {query}
  10. I was I quoted you because you asked a similar question, sorry if there was any confusion.
  11. I agree with you. This workflow is the best Alfred unit converter I've come across yet It interprets input sensibly and runs quickly :-) Agreed. designandsuch, is there a reason why the workflow requires the user to hit enter to get results? Why not preview the result of all possible matching calculations? I often just want to look up a conversion quickly and hitting enter is an additional key press. Besides, sometimes I might be interested in the other outputs too. One typo: Line 727 of units_v2.php should use the currency code "nzd" not "znd". EDIT: Seems like the workflow actually does preview the results once you add a space to the end of your query, and that hitting return simply does this for you. Why is the terminating space character required?
  12. Thanks for that Jude! I've gone ahead and modified the script myself anyway (you can re-download it from the same link in the first post). The new version tidies up that annoying extra "blank" tab in addition to working when Chrome doesn't have a window open. If someone could confirm that everything works now that'd be great :-)
  13. I'm currently working 8am-3am days (well, studying, technically), and probably will be for the next few weeks, but if you're still having trouble on, say, the 24th of June post here again mrwayne and I'll be happy to look into it :-)
  14. No problem :-) Glad you like it!
  15. It'd be neat to be able to use the mini player to add the currently playing song to a particular playlist. I'm sure it'd be possible to create a workflow to do this, but I wouldn't know how to go about making a script filter (I intend to remedy that when I next have time ), and it seems like something that might be more appropriate as a built-in feature. Just a thought :-)
  16. Those two things did it. That said, I actually really really like being able to add songs to Up Next with Alfred like that, so if there was a way of accessing both functionalities natively I'd be rapt :-) In the meantime, I'll see what I can dig up in the way of workflows. Thanks Vero!
  17. Maybe :-) So Alfred behaves differently for you?
  18. Yeah, but that doesn't cause the album to play, just that one song, after which iTunes returns to the previously playing content. Hitting return seems to have the same effect as manually adding the selected song to Up Next and skipping whatever track's currently playing.
  19. Is it possible to use the mini player to play an album? When I search for an album and hit return it opens that album rather than playing it (modifier keys don't make a difference either). I thought I'd check to see if there was a built in function before I put together a workflow.
  20. OK, that's interesting, it definitely works fine on my end. I can't look into that right at the moment, but I'll get back to you when I get a chance. Roughly how long does it take Chrome to launch from closed for you? In seconds, and 'bounces' if you can.
  21. OK, I'd suggest making a new thread in Workflow Help & Questions about this, since your problem seems a little unrelated at this point (given that the script's misbehaving in AppleScript Editor. You'll probably get more people's attention that way :-) I have a couple of vague ideas which may or may not help, but I'll hold off posting those for now.
  22. This might help :-) http://stackoverflow.com/questions/4956445/virtual-machine-browser-is-considered-by-the-applescript-if-parallels-are-instal
×
×
  • Create New...