man is a handy terminal command for looking up how to use other bits of macOS Unix subsystems
Usually though I end up opening 2 terminal since man pipes its output through a pager - which is handy and to at the same time
It means you CAN scroll forwards & backwards but you can have the command docs and type at the same time
One you end the output its no longer on screen
So a recent question prompted me to go peek at how to use man better
And I found pman
A command you can add to your shell and it pops up Preview with a nice formatted document
The entire command is
man -t <THE SPECIFIC MAN ITEM OR FILE YOU WANT TO SHOW HERE> | open -f -a Preview
and of course you an add it to zsh by opening .zshrc
edit the file and add
@JeanYves you can use the âpstopdfâ command line tool to convert postScript format files to PDFâs.
And then you can open the created PDF document with the âPreview.appâ.
This is an example based on Normans script, but made as an AppleScript.
set toolName to "ls"
set manPDFPath to "/tmp/" & toolName & ".pdf"
set manPDFFile to do shell script ("man -t " & toolName & " | pstopdf -i -o " & manPDFPath)
delay (1.0)
set openManPDFFile to do shell script "open " & manPDFPath & " -a Preview"
@MonkeybreadSoftware Normanâs forum post was about easily accessing the man pages of a command line tools.
As far as I can tell, it has nothing to do with using Xojo.
So why would anyone consider paying for irrelevant and unnecessary plugins ?
When there is a free readily available tool built into the operating system.
This is just my hint, that if Norman likes to automate this with a Xojo app to convert the Postscript from man page output to PDF, he can use the plugin.
And if Dave wants to do the same in his app, he can check CGPSConverter functions in CoreGraphics framework, which should also be useable in Swift.
@MonkeybreadSoftware Norman was sharing his method using a shell script, to open man pages as a PDF in Preview.
A Xojo automation project was never mentioned or implied.
Dave like myself codes in Swift for Apple platforms, and like myself thinks Xojo sucks.
And his project as shown was being written in Swift, so sgain no Xojo needed there either.
So it seems to me like your simply hijacking this thread to flog your irrelevant plugins.
@MonkeybreadSoftware Iâm not on Ventura, I was simply trying to show a free easy way of converting Postscript files to PDFâs.
And unlike you, Iâm not looking to fleece people of there money, for any help I offer on forums.
And if I where on Ventura, I would still find a free native way to do it, without nonsense plugins.
So my point here is, your irrelevant plugins are not needed for anything related to this thread.
I found out today after conversations with @HalGumbert (who is running Ventura)
that Apple has drastically changed the CLI arguments for the MAN command.
Luckily we found an easy alternative so my app can move forward
The âman -wKâ doesnât work and you need to use âmanpathâ instead. And Iâm sure that is not the ONLY change Apple made.
Yeah the âpstopdfâ shell script does work on Catalina Big Sur and Monterey.
Dave said that the man command line tool has changed on Ventura, but Iâm sure there is a way to create a similar shell script to do the same thing on Ventura.
But until I upgrade to Ventura, I canât speculate how the shell script would need to change.