vitor Posted February 7, 2022 Share Posted February 7, 2022 (edited) Usage Search through installed AppleScript dictionaries via the asdic keyword. ↩ to open. The first run will take a few seconds to find the dictionaries, but subsequent runs will be instant. Updating the dictionaries list is done automatically but can be forced with ⌘⌥⌃↩. A minority of apps use an older dictionary format which can be converted with the Universal Action. ⤓ Install on the Alfred Gallery | Source Edited April 29 by vitor cands, Kelson01 and Alan He 3 Link to comment
vitor Posted February 7, 2022 Author Share Posted February 7, 2022 Saving the second post for debugging instructions, if they are ever needed. Link to comment
vitor Posted October 8, 2022 Author Share Posted October 8, 2022 Updated to 2022.4. Add configurable keyword. Link to comment
Jasondm007 Posted February 13 Share Posted February 13 Hi @vitor - This is an awesome workflow! Thanks for sharing!! I have a couple of apps whose AppleScript dictionaries work perfectly fine (and are visible in the Script Editor's Library pane) but aren't visible in the workflow's output. Do you have any suggestions for troubleshooting these apps? For example, one dictionary that I use quite a bit, which won't load correctly, is DEVONthink 3. The other apps are all really minor; DEVONthink 3 is, really, the only important one. Thanks for any help you can lend, and for the great workflow! zeitlings 1 Link to comment
vitor Posted February 13 Author Share Posted February 13 Run :applescriptdictionariesforceupdate to force an update of the cache. May take a couple of minutes. If it still does not show up, where do you have DEVONthink installed (the full path)? Link to comment
Jasondm007 Posted February 13 Share Posted February 13 @vitor Yeah, I've run that several times (re:forced update). But it never seems to find DEVONthink. The app's installed in my applications folder: /Applications/DEVONthink 3.app Link to comment
Jasondm007 Posted February 13 Share Posted February 13 (edited) @vitor I'm not sure if it's relevant, but DEVONthink's SDEF file doesn't appear to be located in the usual place as most applications (i.e., it's not located in the app's Contents/Resources/ folder). See screenshot below. Path: /var/folders/l1/_hr3npwn4nz5m9j85w9_6g4c0000gn/T/DEVONthink 3.sdef I don't understand enough about how this works, but when you close the window above (for the DEVONthink library) the sdef file also automatically deletes itself from that location. It's odd. To see if it changed locations, I removed DEVONthink's library from Script Editor, and then added the app back ... and its SDEF always appeared at this location (i.e., when open - otherwise it magically disappears from that location). Edited February 13 by Jasondm007 Link to comment
vitor Posted February 14 Author Share Posted February 14 Indeed that will be the cause. I’ve poked a bit around the app but didn’t find it either. If you’re able to contact them and get how they’re storing it, I may be able to add support for it in the workflow (using that folder won’t work, because it’s not a fixed path for all users). Link to comment
Jasondm007 Posted February 14 Share Posted February 14 3 hours ago, vitor said: Indeed that will be the cause. I’ve poked a bit around the app but didn’t find it either. If you’re able to contact them and get how they’re storing it, I may be able to add support for it in the workflow (using that folder won’t work, because it’s not a fixed path for all users). Thanks for taking a look at it, @vitor!! I'll reach out to their developers to see where it's being stored. Link to comment
Jasondm007 Posted February 17 Share Posted February 17 Hi @vitor - This week, I ran several searches on my computer to try and track down DEVONthink's sdef file (e.g., sudo find / -name *.sdef -print 2>/dev/null). However, I was never able to locate it (i.e., beyond the temp one mentioned above). DEVONthink's development also confirmed the lack of an sdef file yesterday. They indicated that it relies on an older suite of files that are internal to the package: /Applications/DEVONthink 3.app/Contents/Resources/DEVONthink 3.scriptSuite /Applications/DEVONthink 3.app/Contents/Resources/DEVONthink 3.scriptTerminology By chance, is it possible for your workflow to use these files? I suspect that I know the answer, but I thought I'd ask. Thanks! Link to comment
vitor Posted February 18 Author Share Posted February 18 2 hours ago, Jasondm007 said: They indicated that it relies on an older suite of files that are internal to the package: /Applications/DEVONthink 3.app/Contents/Resources/DEVONthink 3.scriptSuite /Applications/DEVONthink 3.app/Contents/Resources/DEVONthink 3.scriptTerminology By chance, is it possible for your workflow to use these files? I suspect that I know the answer, but I thought I'd ask. Thanks! Yeah, I found those when I poked around but unfortunately opening them didn’t work like with sdefs. Jasondm007 1 Link to comment
zeitlings Posted February 22 Share Posted February 22 As a quick fix, you could create the sdef for dt3 in the terminal. Then you just have to move it to a place where the workflow can detect it. sdef /Applications/DEVONthink\ 3.app > DEVONthink3.sdef Jasondm007 1 Link to comment
vitor Posted February 23 Author Share Posted February 23 On 2/22/2023 at 12:07 PM, zeitlings said: Then you just have to move it to a place where the workflow can detect it. Not exactly, because the workflow also depends on knowing where the app is so it can show the proper name and icon. But the sdef command is a good idea! I can’t just make it work for DEVONthink and other apps though because running it always opens the app. Which is a weird experience if your cache is rebuilding and suddenly a bunch of apps open. I went back and forth with a few options and ultimately decided on a Universal Action approach. @Jasondm007 Please update from within Alfred and try the new version. Use the Generate AppleScript Dictionary action on DEVONthink and it’ll show up in the workflow from then on. I’ve also removed the :applescriptdictionariesforceupdate in favour of updating with fn↩ on any result. Jasondm007 1 Link to comment
Jasondm007 Posted February 24 Share Posted February 24 Sorry for the slow response, @vitor. Thanks for updating the workflow! This is awesome!! Unfortunately, I received the following error when trying to generate a dictionary for DEVONthink: Am I correct that this new action in the workflow requires Xcode to be installed? I uninstalled Xcode a long time ago from my machine. But I guess I could always add it back again to get this part of the workflow up and running. Thanks again for all of your help! Link to comment
vitor Posted February 25 Author Share Posted February 25 Indeed it looks like it needs the full Xcode for that part of the workflow to run. Kind of a heavy requirement but not much we can do. If you uninstall it after the dictionary creation, it should continue to work. Jasondm007 1 Link to comment
vitor Posted April 29 Author Share Posted April 29 Updated to 2023.3.Change cache rebuild shortcut to ⌘⌥⌃↩.Replace deprecated readDataToEndOfFile with readDataToEndOfFileAndReturnError. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now