Re: Man entry to pdf variant command
Re: Man entry to pdf variant command
- Subject: Re: Man entry to pdf variant command
- From: Laine Lee via AppleScript-Users <email@hidden>
- Date: Sun, 31 Jan 2021 14:22:19 -0600
- Thread-topic: Man entry to pdf variant command
try
set z to the clipboard
on error
set z to ""
end try
set x to "/usr/local/bin/"
display dialog "Specify the executable name or the documentation request
command:" default answer z
set z to text returned of result
--display dialog z
if z contains ("" & space) then
set y to x & z
do shell script "{ echo '.ps 7
.ll 6i
.ce 600' ;" & space & y & space & "; } |
/usr/local/bin/groff -fC -dpaper=l -P-pl -P-p -ms -Tpdf | open -f -a
/Applications/Preview.app"
else
set x to z
do shell script "man -t" & space & x & space & "| open -f
-a /Applications/Preview.app"
end if
I should probably reiterate that I upgraded groff to GNU troff (groff) version
1.22.4 by installing groff using Homebrew. This AppleScript won’t work under
Mojave (possibly more recent systems, too) unless groff is upgraded to a
version that allows specifying the pdf device.
Laine
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden