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.
@JuliaTruchsess I understand that this forum thread is about shell scripting, nothing else.
If you actually go to the top of the thread, and read Normanâs original posting.
He was sharing a shell script on how to display command line tool manual files in a Preview window, as opposed to the Terminal window.
Dave was showing an app he is making with Swift in Xcode, to do the same thing in an app window.
âJeanYvesâ was Ponting out that in Ventura, the Preview app no longer converts a PostScript files to text or PDF format.
And I was pointing âJeanYvesâ in the direction of the âpstopdfâ command line tool, to convert the PostScript file into a PDF before trying to open it in Preview.
At no point was Xojo ever in anyway related to this forum thread, so to âuse CGPSConverter via declaresâ in Xojo is totally and utterly irrelevant.
Monkey Breadâs Xojo plugins are also redundant in this topic, as guess what !
This thread has nothing to do with Xojo, so Xojo plugins are also not require.
Monkey Breadâs Xojo plugins, are only ever required in Xojo projects, to fill in all the gaping holes in Xojoâs capabilities.
The other way you can tell this thread has nothing to do with Xojo, is that I was part of the conversation.
If this thread did have something in anyway related to Xojo, you would not see me here, as unlike you, I learned that Xojo is not worth my time and energy to talk or even think about.
This forum in general is not specifically a Xojo forum, it is for users of many different languages and developer tools., so youâll find many non Xojo related forum threads, and most of the ones that are related to Xojo, are usually critical of that third rate developer tool, an rightly so.
But luckily for me, this particular forum thread HAS NOTHING TO DO WITH XOJO.
Itâs about shell scripting, that doesnât require that awful Klingon like syntax used in Xojo declares.