iandol Posted March 2 Posted March 2 (edited) I usually learn best when I can get code into a debugger and breakpoint my way through the code. I do this with Ruby and Lua plugins by using remote debugging. The docs for Ruby are here: https://github.com/ruby/debug#remote-debugging and the Lua tool here: https://github.com/pkulchenko/MobDebug — remote debugging allows you to "hook in" to any code run by a different app (i.e. Alfred could run ruby without any explicit debug command in place, but with a breakpoint command a remote debugger could hook in to that script). It seems Javascript (JXA) is a useful language for macOS automation. I see @vitor for example uses it for his great ChatGPT workflow. So my question is: is there a remote debugging interface that would enable me to run an Alfred workflow, and breakpoint a Javascript script and inspect it as it runs? Edited March 2 by iandol
iandol Posted March 2 Author Posted March 2 (edited) To answer my own question (after trying to do this in VSCode, so many JS tools its hard to find what you want...) Open Safari, enable developer tools then enable this option: Now in your JXA script type in debugger; where you want, e.g. Now use Alfred as you normally would and when Alfred runs the script, the remote javascript debugger will pop up. Cool! Edited March 2 by iandol
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