Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. Today
  3. Alfred 4.0.6 Build 1124, Friday 8th November 2019 MacOS Catalina 10.15.1 (19B2106) If I attempt to switch to a fullscreen app from a windowed app or go from a fullcreen app to a windowed app the newly selected app is shown but it does not have focus. If I switch from one windowed app to another windowed app then all is fine. Any ideas ?
  4. @dfay, @vitor & @deanishe - Thanks for taking the time out to help a coding neophyte, like myself. I really appreciate it. Honestly, I can't thank you guys enough. Alfred's great, but it wouldn't be the first thing I'd install on a Mac, if it weren't for you guys and others on the forum. I've learned a ton from you guys! For others who may be struggling with script filters and JSON outputs, I've uploaded a new version of the workflow to use as a learning example: Download Workflow. The workflow combines everyone's suggestions from above: AppleScript, JavaScript & Ruby. All three are nearly identical, with the exception that the JavaScript and Ruby versions lack the prefix "Same Words" in the subtitle. This should be enough to get you started, if you're also struggling to get your head around how script filters' outputs work.
  5. Do you sync your preferences? No, I don't sync my prefs. Do you have an external screen? Do you plug and unplug from it? Yes I do! I'll try this out. I'll have to check when I encounter this next. Do you have any errors in Console after wake? I'll have to check when I encounter this next. If you fully quit Karabiner and any other apps that may be interfering, does the issue still occur? I'll try the two above first and then i'll come around to this. Thanks!
  6. when i try opening link in chrome i go to: http://searchguide.level3.com/search/?q=http%3A//derekminner.com/docs/Calendar%20Quick%20Entry.alfredworkflow&r=&bc= how can i use the link for alfred workflow?
  7. I’d find it hard to believe that any Pinboard Workflow wouldn’t use a cache. Not doing so would be a fast way to be blocked from the service.
  8. In Ruby, you’d do this: require 'json' require 'pathname' script_filter_items = [] Pathname.new(ENV['HOME']) .join('Notes') .children .select(&:directory?) .each { |path| script_filter_items.push(title: path.basename, arg: path) } puts({ items: script_filter_items }.to_json) You can use that code as-is in a Script Filter (with Language set to /usr/bin/ruby) between your other steps in Alfred.
  9. I'd like to see my pinboard bookmarks in the default search scope the same way Safari/Chrome's are available in the Web Bookmarks feature page. Rusty Pin in particular uses a cache for its bookmarks so they're all available locally in a .plist file. It would just be cool to be able to plug those in to the default results
  10. After updating to the prerelease, the issue is fixed! Thank you very much for your attention to this issue. Please let me know if there's anything else that I can do to help test. I ❤️Alfred.
  11. That's normal, tbh. It's insane. It'd probably be a better use of your time trying to re-implement your workflow in a sensible language (if that's possible) than muddling through with AppleScript. It's so crazy, I still don't really understand it after using it for years.
  12. What are you trying to achieve, exactly? Why can't you use one of the existing Pinboard workflows like the one you linked to?
  13. @stdavis could you update to the 4.0.7 b1130 pre-release and let me know if this fixes the issue?
  14. @afzalive could you please update to the 4.0.7 b1130 pre-release and let me know if your issues are resolved?
  15. @afzalive If your metadata is in good health, you shouldn't experience any issues with this change. Having said that, I think you may have hit the nail on the head with this. I'm going to do a bit more investigating and perhaps back out the default sort order change for a 4.0.7 pre-release. Cheers, Andrew
  16. @rtlong Can you please provide more details about your setup? Which version of macOS are you using? Which version of Alfred are you using? What Mac + monitor setup do you use? (e.g. retina or not, do you change setup between laptop and external screen) Users who've reported experiencing an issue with this seem to disappear and not come back with further questions after these suggestions, so it's difficult for us to establish *what* is the source of the issue to help future users. This leads me to believe the solution is very simple, but once users don't experience the issue anymore, they don't think of sharing their solution. Cheers, Vero
  17. @ionstorm Thanks for providing some details; Here are a few more questions to help establish what's going on Do you sync your preferences? If so, to what service and what is the exact path? There's a possibility that if you're using a service where the file isn't available on wake (e.g. Google Drive), Alfred doesn't think you have any customisations and reverts to default preferences, in which case he'd switch back to Alt + Space, the default hotkey. Do you have an external screen? Do you plug and unplug from it? Some users have reported Alfred not appearing on screen after wake, but it turns out that Catalina has mis-configured the screen dimensions and Alfred is really appearing off the visible screen. In that case, you should be able to use your hotkey, blindly type an app name and launch it. Do you have any errors in Console after wake? If you fully quit Karabiner and any other apps that may be interfering, does the issue still occur? Cheers, Vero
  18. @afzalive More relevant than Alfred build versions (which are unlikely to be the source of your slow results), which version of macOS are you using? Alfred relies on the macOS metadata, so if you've recently updated to Catalina, there's likely an issue with the underlying metadata index. Are you seeing "Waiting for results from macOS..." when doing a file search? When you see the "Waiting for results" in Alfred, it is Alfred waiting for the macOS metadata server to return file results to him, and the performance at this point is entirely outside of Alfred's control. Having said that, it is quite unusual to see this message in Alfred. First, make sure you're using Alfred 4.0.6+. There are then a few things to try to fix the issue in Catalina: Reset Alfred's default search scope in the Features > Default Results to make sure Alfred isn't looking in any locations that are no longer relevant. Rebuild the macOS metadata index using the shortcut in Alfred's Advanced preferences. Temporarily create a new user account, switch to that user and see the performance on that account, in case any other installed apps on your main profile are interfering with search interactions / performance. Let us know how you get on. Cheers, Vero
  19. I would like it show a dynamic list of all directories of depth=1 in the ~/Notes directory. I don't mind programming, I just wasn't sure how to go about it. I assume via a script so?
  20. I seem to have this intermittent issue where Alfred just doesn't respond when my machine wakes from sleep. Info What you were doing when the issue happened Woke the machine up from sleep Whether you were able to replicate it a second time by performing the same action Nope. Happens intermittently. Include any screenshots that might help us Unfortunately no. There's no visual symptom. Alfred just doesn't respond. Include the Alfred version & build number you are using Alfred 4.0.6 [1124] Include your OS X version macOS Catalina 10.15.1 (19B88) Other information which might possibly be relevant I'm using CMD + SPACE as my hotkey (replacing Spotlight) I use Karabiner version 12.8.0. This also malfunctions on occasion which may be a contributor to this problem - but I have no clue. Please let me know if you need any other information that you think might help. Thanks!
  21. @vitor Thanks a ton for the explanation and the two working examples. This was extremely helpful, and it got me thinking that I could probably figure out a way to use my existing AppleScript to generate the list and then feed it into your JavaScript or Ruby script filter examples? It's a pretty complicated AppleScript - for my scripting ability, anyways - that generates the list. To be sure, I don't disagree with any of your statements - or others' on this forum - about AppleScript's 💩 status. But it would take me ages to learn one of these better languages, and then reverse engineer the existing AppleScript. As you can tell, I hardly understand AppleScript 😉 @dfay Thanks for the sources above! One of the first failed variations that I mentioned above came from my hackneyed attempts at pulling out pieces of your windows workflow (the one that works for Preview and a few others apps). When @deanishe mentioned a json.scpt file, I knew that I had seen one in your workflow, so I used it in several iterations. But I could never get any of them to work. However, I completely forgot about your more streamlined workflows for only Preview and Finder. In the multi-app version, I think stringing all those variables together for the different apps got me a little turned around. In any case, I'll go back and take a look at those other versions. Thanks a ton!! I can't thank you both enough!!
  22. In the latest versions of Alfred 4 and Alfred 3, typing something like "f doc" takes way too long to return results. I have been able to track this down to the builds that contain the following changelog: Alfred 4.0.4 Build 1111 Alfred 3.8.3 Build 967 Any build before this change does not face the same issue and displays the results very fast. I had to revert to Alfred 4.0.2 (1088) since Alfred 4.0.3 cachefly link yields a 2 byte dmg.
  23. TextExpander (legacy) is what they renamed TE Touch to be. Here's the setup in Hazel: this assumes anything you don't want to sync is tagged notForTE Rule 1. for your Alfred snippets folder: Rule 2. (same location) with the embedded script set to the first line here (I also sync to Copied, but I'll just cover TE for now) -- replacing the squiggles with the correct path to the script below: AlftoTE.py you'll need to specify the TE group where you want the synced snippets to appear and add the uuid to the script. I just created a new TE group for sync purposes, then went to Settings.textexpandersettings > Show Package Contents and found the new group file there. The uuid is just the group file e.g. group_E65531A8-88BA-4619-B5D1-B954AC3DC0FF_4733813705.xml without the group_ at the beginning and the .xml at the end e.g. E65531A8-88BA-4619-B5D1-B954AC3DC0FF_4733813705 #!/usr/bin/python import argparse # from plistlib import readPlist, writePlist - no longer writing TE plists directly import json import os import uuid from datetime import datetime # UUID for target group for new snippets in TextExpander teTargetGroup = "your uuid goes here" def get_te(abbreviation=None, plain_text=None, label=None): return { 'abbreviation': abbreviation, 'abbreviationMode': 0, 'creationDate': datetime.now(), 'label': label, 'modificationDate': datetime.now(), 'plainText': plain_text, 'snippetType': 0, 'uuidString': str(uuid.uuid4()).upper() } def a2te_replacements(s): s['snippet']=s['snippet'].replace('{clipboard}','%clipboard') s['snippet']=s['snippet'].replace('{cursor}','%|') # in theory this should be extensible to handle date formats and date math... return s def transform(direction, source): if direction == 'AlftoTE': source = source['alfredsnippet'] source = a2te_replacements(source) return get_te(abbreviation=source['keyword'], plain_text=source['snippet'], label=source['name']) else: raise Exception('Unsupported direction') if __name__ == '__main__': parser = argparse.ArgumentParser(description='Alfred-Expander Sync') parser.add_argument('direction', choices=['AlftoTE'], default='AlftoTE') parser.add_argument('--alf', default=None, help='Alfred json snippet') args = parser.parse_args() source = args.alf with open(source, 'rb') as source_fp: source_json = json.load(source_fp) s = transform(args.direction, source_json) # use TE AppleScript rather than modify plist directly cmd = """osascript -e 'tell application "TextExpander" set g to every group whose ID is \"""" + teTargetGroup + """\" tell item 1 of g make new snippet with properties {plain text expansion:"""+"\""+s['plainText']+"\","+"abbreviation:"+"\""+s['abbreviation']+"\",label:\""+s['label']+"\"}"+""" end tell end tell'""" os.system(cmd) Incidentally the argument parser is completely unnecessary since there's only one option, but it's a legacy from having used this to get started: https://github.com/markphilpot/sync_expanders
  24. Or to continue with AS, look at the examples here: This is what I used to figure out how to do the recent folders and active folders scripts in And here's a solution for you: set theList to {"Red", "Green", "Blue"} # What next? -- import JSON library set workflowFolder to do shell script "pwd" set json to load script POSIX file (workflowFolder & "/json.scpt") -- Create and add items set theItems to {} repeat with i from 1 to count theList set end of theItems to json's createDictWith({{"title", (item i of theList) as text}, {"uid", i},{"arg", (item i of theList) as text}, {"subtitle", "Same Words " & (item i of theList) as text}}) end repeat -- Create root items object and encode to JSON set itemDict to json's createDict() itemDict's setkv("items", theItems) return json's encode(itemDict)
  25. The fact that you’re using AppleScript makes the task significantly harder. AppleScript is an awful language: it’s too different from other languages, lacks several features, and is badly documented. That in turn makes it that few people want to use it, meaning there’s less people to help you and less people making resources for you to learn from. AppleScript falls flat on its goal of being a language for people who don’t know how to program. It’s sole redeeming quality is that it can talk to GUI apps in a programatic way built into the system. But I advise you to use it for that alone, and get out and use something else as soon as possible. If you want to learn to program, do not start with AppleScript. It’s weighing you down. At the very least, as @deanishe mentioned in the thread you linked to, use JXA (JavaScript for Automation), which gives you the only good part of AppleScript in a better (yet still not good) language. AppleScript doesn’t understand JSON, you have to build it by hand and that’s not a good situation to be in. You want to use a language that can build the JSON for you from a simple list you give it. JavaScript (works with Alfred’s /usr/bin/osascript (JS)): const my_list = ['Red', 'Green', 'Blue'] // Your example list let script_filter_items = [] // We will build this array with the elements for the Script Filter my_list.forEach(element => { // For each item in your list script_filter_items.push({ 'title': element, 'subtitle': element, 'arg': element }) // Add them to the empty array }); JSON.stringify({ 'items': script_filter_items }) // Transform it into JSON Alfred understands Ruby require 'json' # We need the JSON gem, to be able to use JSON functions my_list = ['Red', 'Green', 'Blue'] # Your example list script_filter_items = [] # We will build this array with the elements for the Script Filter my_list.each do |element| # For each item in your list script_filter_items.push(title: element, subtitle: element, arg: element) # Add them to the empty array end puts({ items: script_filter_items }.to_json) # Transform it into JSON Alfred understands
  1. Load more activity
×
×
  • Create New...