musings, realisations and contemplations.

Journal Prompter

Following on from my recent therapy sessions, it was suggested that journalling could be something that helps to offload any thoughts/concerns/emotions so they don't build up, and cause problems or issue later on in life. This page is all about how I got started.

Getting Started

I've always liked the idea of having a little pocket book to jot stuff down in, when in meetings or out and about, but I've never actually followed through on it. Living in technology, it's always so easy to jot notes on your phone or laptop into whatever app you use. Whilst this does have strong availability and ease associated with it, it just feels a bit too easy. Sometimes stepping off the well-trodden path can be challenging, however by doing so, it can be more rewarding as more effort is required.

For my journalling, I settled on a Leuchtturm 1917 A6 dotted notebook classic, and a Fischer Spacepen. I was given the Spacepen at an IT trade show many moons ago, but never really used it. Most probably as I mentioned above about digital note taking! I figured the spacepen would sit nicely in the pen loop on the side. Whilst I could have got a larger notebook, my requirements were to be able to take it with me as I go about my day, and write a little and often. The size of the notebook was probably the most important aspect as I didnt want to feel overwhelmed or intimidated with a large A4 notebook and all their large blank pages!

My journalling notebook with Fischer Spacepen

I also treated myself to the pen loop on the side. A little crazy that this is an “add-on” for a notebook, but I figured if I'm going to do this, I want to do it right!

I am now ready to journal! For the first few days I just treated it like a diary, and wrote some thoughts on how the day went. Was it positive? Negative? How did I feel? What went well? What didn't?
This was fine, however I felt it was just becoming a “Dear Diary” which didn't fully meet my needs. I wanted to journal to help process my thoughts of the day and to do some self-help therapy on myself.

Searching the internet, there are so many articles on journalling, and some have lots of “Getting Started” journal prompts.

For example:

What would I thank my past self for?

or

Write a list of 10 things you want to be able to remember during bad days.

These looked perfect! However, I don't want to search online everytime I want a bit of help journalling... I needed a technical solution! My requirements were:

Prompter

In my job role, I use PowerShell for a lot of automation and management of IT stuff, so it was only natural that I use this. I also have been experimenting with Powershell Universal at home with a view to see how and if this can fit into my workplace. PU is an amazing set of tooling to compliment PowerShell scripts. The key feature for me, was the Dashboards\App feature – being able to run PowerShell in a web browser. I'm no developer at all, so this suited me well, and allowed me to tick off my first requirement!

First off, I started collecting lots of prompts that looked roughly useful (I didnt over think it) and stored them in a CSV file, with some additional fields:

Prompts in CSV

I converted this file to JSON so I could easily update it programmatically, and also should I want to store more data against each prompt in the future.

Prompts in JSON

Great! Now I needed a proof of concept PowerShell script. This is generally how I program or script something – I just start with getting some visible results, and then build on it with error handling and all the other good stuff that I should do. This script however is just for me, nobody else so to be quite honest, I dont care to much about it's formatting or syntax!

$File = "D:\PromptHelper\Prompts.json"
$Record = "D:\PromptHelper\Prompts-Record.log"
$PromptObj = Get-Content $File -Raw |ConvertFrom-Json

# Get a Random prompt
$Prompt = $PromptObj | Get-Random

# format the history record
$OutRecord = "$(Get-Date -Format 'yyyy-MM-ddTHH:mm:ssZ'); $($Prompt.Category);$($Prompt.Prompt)"

# write the history record to the record file
$OutRecord | Out-File $Record -Append

# show me the prompt that was randomly chosen. 
$Prompt.Prompt
$Prompt.ID
$Prompt.Count
$PromptObj[$Prompt.ID-1].Count +=1

Now, time for PowerShell Universal and convert it into an App. I'm not going to go into the process of how I did that, that isn't important. That said.. here is the script that I'm running:


New-UDPage -Url "/Home" -Name "Prompt Generator" -Content {

    $RootPath = "C:\Scripts\PromptGenerator"
    $file = Join-Path $RootPath "Prompts.json"
    $record = Join-Path $RootPath "PromptRecord.log"

    $PromptObj = Get-Content $File -Raw |ConvertFrom-Json
    $PromptObj[$Prompt.ID-1].Count +=1

    New-UDTextbox -Id 'TodaysPrompt' -Multiline -FullWidth -RowsMax 10 -Disabled

    New-UDButton -Text 'Give me a Prompt' -ID 'TheButton' -OnClick {

        If ((Get-UDElement -Id 'MyCheckbox').checked){
            $Prompt = $PromptObj | Where-Object {$_.Count -ne 0}| Get-Random
        }else{
            $Prompt = $PromptObj | Get-Random
        }

        Set-UDElement -Id 'TodaysPrompt' -Properties @{
            Value =  "$($Prompt.Id) | $($Prompt.Category) | $($Prompt.Prompt) | $($Prompt.Count)"
        }
        Set-UDElement -ID 'TheButton' -Attributes @{disabled = $true}
        
        $PromptObj | ConvertTo-Json -Depth 2 | Set-Content -Path $File

        $OutRecord = "$(Get-Date -Format 'yyyy-MM-ddTHH:mm:ssZ'); $($Prompt.Category);$($Prompt.Prompt)"
        $OutRecord | Out-File $Record -Append

        Sync-UDElement -Id 'Table'
    
    }   
    New-UDCheckBox -Id 'ReusePrompts' -label 'Only prompts not previously used' -Checked $true

    New-UDDynamic -Id 'Table' {
        $SortedRecord = Import-Csv -Header Date,Category,Prompt $record -Delimiter ";" | Sort-Object Date -Descending 

        $Columns = @(
        New-UDTableColumn -Property Date -Title Date
        New-UDTableColumn -Property Category -Title Category
        New-UDTableColumn -Property Prompt -Title Prompt
        )
        $Page:Table = New-UDTable -Id 'history' -Data $SortedRecord -Columns $Columns -Title 'Prompt History' -DefaultSortDirection descending
        $Page:Table
    }

} -Generated

And this is how it looks when run:

Prompt Generator

Now, I can access this whenever at home, or remotely through my VPN on my phone, and it renders perfectly for any screen size. I press the button, and it provides a prompt in the top box, and then disables the button to prevent generating more prompts. Obviously a reload of the page re-enables the button, but this simple logic is enough to stop me generating a new prompt if I don't like the one I've been given. Also note the check box, that ensures they are not re-used.

Conclusion

It's been approximately one month since I started journaling – and I don't do it every day, but I do it regularly. When I'm stuck, I fire up my Prompter app, and use that to get me started.
As the prompts generated generally have a greater reflection value on them compared to my usual day-to-day thoughts, I've also been jotting down in the front of my journal what prompt has been used, with a page number to my response. My hope is that I can quickly review this in months.

My prompts for reflection

Overall, I'm enjoying doing journaling – the element of writing stuff down does strangely help me process life and definetly does help me offload and wind down at those stressful moments!