Applescript I

Uma pequena script da minha biblioteca em Applescript para quem precisa de ver as “man pages”.

set theCommand to (text returned of (display dialog “Comando UNIX:” default answer “” buttons {“OK”, “Cancel”} default button 1)) as string
set myManPage to (do shell script “man “ & theCommand & ” | perl -pe ‘s/.\x08//g’”)

tell application “TextEdit”
activate
make new document at the beginning of documents
set the text of the front document to myManPage
end tell

Abrir a Applescript no Script Editor. [Mac only]


Comentários

Deixe um comentário

O seu endereço de email não será publicado. Campos obrigatórios marcados com *

This site uses Akismet to reduce spam. Learn how your comment data is processed.