Jump to content

deanishe

Member
  • Posts

    8,759
  • Joined

  • Last visited

  • Days Won

    522

Everything posted by deanishe

  1. Why are you accessing the file directly? Have you read the docs? Use the dictionary exposed at Workflow.settings. # Load saved symbols or empty list symbols = wf.settings.get('symbols', []) # Add a new symbol symbols.append('AAPL') # Update the settings dict to ensure the changes are saved to disk wf.settings['symbols'] = symbols
  2. It has the same API as a normal dictionary. I think the docs make this pretty clear. So, yeah, if you save new data under the same key, it will overwrite the old data.
  3. I'm not sure I really follow you. You want the user to enter a currency symbol and save that for later use? For something that simple, you should probably just use the settings API. cache_data and store_data can easily do such a simple thing. In fact, they're probably overkill as they're designed for storing arbitrary data structures, not just simple strings.
  4. Could you explain what you mean by "reference"? It sounds like you want a list of folders, but with names you've assigned, not the actual folder name. If so, have you thought about using a List Filter with arg set to the real path?
  5. What do you mean, it "doesn't appear in the list of Mac Aliases"? It wouldn't: it's not an alias, it's a symlink. AFAIK, Alfred resolves symlinks as the target, not the symlink. So if you have a symlink "Clark Kent" that points to "Superman", you'll only get search results for "Superman". You can, however, browse the symlink, which doesn't work with aliases. If you just want to find folders under a different name, adding Spotlight Keywords via the Get Info window is a cleaner way, imo. Aliases are silly things: only Finder treats them as if they were symlinks; everything else treats them as the files they really are.
  6. Use symlinks instead of aliases. They have the advantage of also working with UNIX programs, like workflows.
  7. I don't think there's much Alfred can do about that. It just says, "hey Chrome, take focus!" It's Chrome that's focussing the wrong window.
  8. Restart Alfred. The history is kept only in memory.
  9. The scripts seem to work for me, but I'm not running Sierra. If you've tried rebooting, I'm all out of ideas.
  10. Reboot, tbh. If that doesn't work, please post some of your code that isn't working. Descriptions and pictures are not enough.
  11. 99% sure the worklow's completely fixed for you. macOS 10.12.4 completely broke a library this workflow uses.
  12. The first question is whether it's possible to pause and resume Dropbox syncing programatically. AFAIK, it isn't. I think your only option is to kill the Dropbox app and restart it. Kill: killall Dropbox Restart: open -a Dropbox Put each of those commands in a Run Script action with Language = /bin/bash, then connect them to Keyword triggers.
  13. Awesome tip! It's so annoying when macOS switches desktops from under you.
  14. You can specify the folder to search in dynamically. Look at the dynamic file search demo workflow included with Alfred.
  15. Most mindmaps are basically trees. Every branch is a subtree. Instead of "flattening" the tree with a filter per level, you call the same filter on each subtree. Your whole collection of mindmaps can be considered a single, large tree. Look how the Safari workflow I sent you browses your tree of bookmarks.
  16. He means much the same as the way browsing your bookmark folders works in the Safari workflow I gave you. No you wouldn't. This is exactly the issue @dfay's suggestion would avoid. You call exactly the same function/Script Filter, but with a subset of the data, and the a subset of those data etc. Aren't you studying computer science? Do you not know what recursion is?
  17. That's just a convenience for users who don't read instructions. GitHub releases are the "official" download source (Alfred-Workflow pulls updates from there), but as I have to build the workflow somewhere anyway, I leave a copy in the repo root, too.
  18. A few lines of Python in the REPL. If I were you, I'd rename the folders and markdown file to match the category names, then write a script to generate JSON files that can be fed straight into Alfred via Script Filters. No need to update the List Filter that way, and no unnecessary parsing of Markdown files on every run.
  19. Here's a better way that works regardless of system language: on isFolder(theAlias) return folder of (info for theAlias without size) end isFolder That gives you a simple true/false.
  20. Use TAB, not ENTER. I'll update the workflow so that ENTER works the same way.
  21. Bit of a long shot, but it may be due to Alfred being English. It appears that your script checks whether the type is "Ordner". Have you tried using "Folder" in Alfred?
  22. Try a normal Run Script action with Language = /usr/bin/osascript (AS) instead. You shouldn't use Run NSAppleScript unless you have a very good reason to.
  23. It has nothing to do with ASCII. Alfred is URL-encoding your arg, as it has no way of knowing whether your input is already correctly encoded or not. The solution is to not use the Open URL action. Instead, use a normal Run Script action (Language = /bin/bash, with input as argv) with the following content: open "$1"
  24. How are you running the script? In Script Editor? With osascript? With a Run Script action? With a Run NSAppleScript action?
×
×
  • Create New...