Group Abstract Group Abstract

Message Boards Message Boards

0
|
2.5K Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Creating a listing of the commands I typed while running Wolfram in a terminal window

Posted 7 months ago
POSTED BY: Paul Nielan
2 Replies
Posted 7 months ago

Thank you Jason. This worked for me. I tested it in both the command line via /Applications/Wolfram.app/Contents/MacOS/wolfram and in a notebook. It is a "pure" journal file in the way I asked for. Will be adding it to my bag of tricks.

It would be nice if the command-line app "logged" like this automatically. In days gone by, my most productive way of working with software in general was a cycle of (working interactively, generating a journal file, using a text editor to improve and format that file, then read it back into the interactive application) and repeat. GUI apps took that ability away for the most part. But the generality and power of a good text editor is still unsurpassed for many jobs.

I used it with CreateFile.

POSTED BY: Paul Nielan

If I understand your request correctly this should do the trick

journalFile[file_] := With[
    {
        inputs = Replace[
            DownValues @ In,
            HoldPattern[RuleDelayed[_, input_]] :> ToString[Unevaluated[input], InputForm],
            {1}
        ]
    },
    Export[file, inputs, "Lines"]
]
POSTED BY: Jason Biggs
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard