If you are using the desktop app, log into your Asana account in a browser, then visit https://app.asana.com/api/1.0/projects
It will spit out an array with the name and ID of every project you have access to in ALL of your workspaces.
When I did it (in Dec 2024) it sorted them by workspace by default. Your mileage may vary.