Jump to content

dfay

Member
  • Posts

    1,054
  • Joined

  • Last visited

  • Days Won

    61

Everything posted by dfay

  1. @Florian you never know when you will need to convert square meters to miles with 19 digits of accuracy.
  2. Clear doesn't have any Applescript support. Without it you'd need to use UI scripting and simulate pressing the keys / mouse clicks that you'd use for the desired actions.
  3. "If it works in a script but doesn't work in Alfred, it's always something about the Path settings. Every time." http://www.alfredforum.com/topic/4959-enoent-path-issues-bash-nodejs/?hl=%2Bbash+%2Bpath I'd take a look at the above - and search this forum for bash path - this comes up a lot and is probably a candidate for a FAQ. From the error message you're getting I'd be pretty sure that the script when run from Alfred doesn't know the path to wp.
  4. In Spotlight results displayed in the Finder (though not in the new Yosemite Spotlight interface), tags with colors appear next to the filename, e.g. Would it be possible to get the tag colors to also appear in Alfred results? I have a Hazel script backing up stuff to Dropbox automatically and applying a red tag to it, so I can easily distinguish the backup from the original in search results. I don't want to exclude the backup directory from Spotlight. So it would be great if Alfred would display the tag colors like the Finder does. thanks Derick
  5. If you're going to explore UI scripting in Applescript, this pair of approaches to finding how to refer to items will be a huge help: http://hints.macworld.com/article.php?story=20111208191312748 http://apple.stackexchange.com/questions/40436/how-to-know-the-name-of-ui-elements-using-accessibility-inspector-or-any-other The first one there is my preference - that's how I found the anchor and the checkbox in the script above. Have fun with it!
  6. call this applescript: tell application "System Preferences" activate reveal anchor "Privacy_LocationServices" of pane id "com.apple.preference.security" authorize pane id "com.apple.preference.security" end tell tell application "System Events" click checkbox "Enable Location Services" of group 1 of tab group 1 of window "Security & Privacy" of application process "System Preferences" of application "System Events" end tell There may be a better way, but Applescript UI scripting (with the authentication when required) is the only way I see to programmatically access Location Services. If you know of another, calling the script in a workflow is trivial.
  7. I'd recommend this workflow as an alternative, unless you need to include the Google Image search terms in the links you post: http://www.alfredforum.com/topic/935-workflowshorten-url-support-googl-bitly-tcn-jmp-isgd-vgd/?hl=bitly#entry9644 It's a general purpose URL shortener offering your choice of shortening services. And for the opposite direction: http://www.alfredforum.com/topic/4843-resolve-canonical-urls-from-shortened-urls/
  8. I wrote this a while ago for viewing Calendar: http://www.alfredforum.com/topic/1855-view-calendar-on-date-with-view/ .
  9. Hi missed this completely, sorry. It is (still) working fine for me under Yosemite.
  10. I haven't changed the code in the workflow at all -- just cleaned up my .bib files. If I get a chance over the weekend I'll give it a shot - it's pretty obvious from your well-documented code how to hook the XML cleaner into bibquery.py .
  11. Ok....another one, in case this is useful for someone else. The workflow stopped working again and was throwing an error after flashing the first few results: PCDATA invalid Char value 28 This is caused by an invisible character which is legal in BibTeX but not in XML . I found it by opening the XML in TextWrangler and searching for \x1C (hexidecimal equivalent of 28), and deleting the character from the corresponding BibDesk entry. Now the workflow works again. Again, downloaded BibTeX has all kinds of dirt scattered in it. Perhaps this would be a nice addition to the workflow: http://lsimons.wordpress.com/2011/03/17/stripping-illegal-characters-out-of-xml-in-python/
  12. There was a long discussion here: http://www.alfredforum.com/topic/526-alfred-as-text-expander/?hl=textexpander#entry2464 with more details on the Applescript that you'd need.
  13. Alternatively, not that I don't love Alfred, you might consider using TextExpander: http://macsparky.com/blog/2011/9/21/web-forms-with-textexpander.html
  14. How random. I had never looked at this workflow before but decided to check it out tonight to listen to a recording of Baroque organ by an organist who happens to be the organist at Trondheim Cathedral.
  15. Depending on what you want to do, this should be easy to set up with custom searches - a workflow probably isn't necessary. See http://blog.alfredapp.com/2011/04/14/alfred-productivity-tips-using-custom-searches/ .
  16. Hmm....that is a file that seems to exist in some people's Alfred installations and not others. The workflow checks for its existence, and if it doesn't exist, it defaults to All. Could you try adding a category in Alfred prefs., and/or changing a category? I'm not sure what it takes for Alf to generate this file.
  17. Like this? http://www.alfredforum.com/topic/4384-workflow-picker/
  18. By the way, I figured out that weird error I had above....I had a pub with year set (by some database's downloaded BibTeX) to 20070904 instead of 2007
  19. As far as I can tell, the only way to get this to display is by including an app bundle in a workflow, right? I tried an Applescript object and a Script -> osascript object and neither produced a progress window or anything in the Alfred workflow log.
  20. Could you clarify the relationship between the files? i.e. there is a separate unique spreadsheet for each Word document? or there is a standard spreadsheet that gets inserted into each Word document? or there is a single Word document describing the rubric into which you want to insert a spreadsheet as well? If the calculations aren't complicated, as you suggest, this might be more easily done by using calculations within a table in Word, rather than trying to deal with moving from Numbers to Word. Directions here are for Word for Windows but they are basically the same on the Mac: http://www.brighthub.com/computing/windows-platform/articles/15649.aspx
  21. Yeah, I just tested it and the Keynote 5.3 version works in Safari with one line (selecting Individual Slides in Keynote) commented out. Here's the script (I also deleted some if statements that would never be true in Safari, just to clean it up, and added your code to render in Reader): -- Safari tell application "System Events" tell application process "Safari" set frontmost to true repeat until window 1 exists end repeat # Render page in Safari Reader keystroke "r" using {command down, shift down} delay 0.02 -- Print; wait until the sheet is visible click menu item "Print…" of menu 1 of menu bar item "File" of menu bar 1 repeat until sheet 1 of window 1 exists end repeat set thePopUp to first pop up button of sheet 1 of window 1 whose description is "Presets" click thePopUp click menu item "Default Settings" of menu 1 of thePopUp --replace if desired with your preferred preset click menu button "PDF" of sheet 1 of window 1 click menu item "Save as PDF…" of menu 1 of menu button "PDF" of sheet 1 of window 1 -- Save as PDF... end tell end tell
  22. You're on the right track here with UI scripting - just need to figure out what parts of the print dialog you need to click. I did this for Keynote, here: https://github.com/derickfay/keynote-to-pdf You might be able to re-use some of the code - look at the Keynote 5.3 version - as I recall that print dialog was the standard OS X print dialog as it would also appear in Safari....they customized it in Keynote 6. It takes some patience and trial-and-error, but it's a task I had to do a couple times a day and it was worth it. These two tools are very helpful for UI scripting: applescript - How to know the name of UI elements using Accessibility inspector (or any other tool) - Ask Different Finding Control and Menu Items for use in AppleScript User Interface Scripting - Mac OS X Hints
  23. file=$(find ${folder} -maxdepth 1 -type f -print0 | xargs -0 stat -f "%m %N" | sort -rn | head -2 | grep -v .DS_Store | cut -f2- -d" ") should be easy to debug...
  24. Haha Shawn got there while I was typing....
  25. I have an Applescript set up to build a directory structure which you can find at https://github.com/derickfay/course-creator/blob/master/Generate%20directories.applescript This should be fairly easy to modify with your desired structure. To include a unique # and customer name you could pass these as the query from Alfred.
×
×
  • Create New...