From time to time I get documentation packages that contain an index.html that links to several pages via a menu. I open all these menu items (pages) manually (via clicking in Safari) and want to export them as PDF. (Once I've done that, I create one Reference.pdf via a macro to combine PDFs that has been posted here.)
I now have a semi-automatic solution that I have to repeat for every tab. I'd like to add a While action that cycles thru all open tabs.
Any advice on how to achieve this, is highly appreciated.
One quick, untested idea: since it sounds like you're keeping all these tabs in their own window, you could save the number of windows in a variable, then have the While condition check the current window count against that variable and have it stop when the number of windows changes (i.e. when the last tab is closed):
No problem, and yes, there is a tab count function, though there are different ones specific to Safari and Chrome (as well as one catch-all function for either). If you just need the macro to stop when the number of Safari tabs reaches 0, you shouldn't even need the prior action: