[GNC] Recent list in file menu

Michael Hendry hendry.michael at gmail.com
Mon Jan 18 05:20:33 EST 2021


> On 17 Jan 2021, at 20:11, David H <hellvee at gmail.com> wrote:
> 
> You can easily check the mru details by doing the following...
> 
> defaults read -app Gnucash
> 
> or
> 
> defaults read -app Gnucash | grep history
> 
> Cheers David H

Yes, I discovered how to read and write the relevant plist using “defaults”, via the man page, and have also inspected it with Xcode.

Here is the output from the command you suggested:

=> defaults read -app Gnucash | grep history
    "/org/gnucash/history/file0" = "/Users/michaelhendry/Documents/Accounts/TestMRU.gnucash";
    "/org/gnucash/history/file1" = "/Users/michaelhendry/Documents/Accounts/ESJE.gnucash";
    "/org/gnucash/history/file2" = "/Users/michaelhendry/Documents/Accounts/RotaryClub.gnucash";
    "/org/gnucash/history/file3" = "/Users/michaelhendry/Documents/Accounts/RotaryCharity.gnucash";
    "/org/gnucash/history/file4" = "/Users/michaelhendry/Documents/Accounts/MDH.gnucash";
    "/org/gnucash/history/file5" = "/Users/michaelhendry/Documents/Accounts/CrashTest/A.gnucash";
    "/org/gnucash/history/file6" = "/Users/michaelhendry/Documents/Accounts/CrashTest/B.gnucash";
    "/org/gnucash/history/file7" = "/Users/michaelhendry/Documents/Accounts/ESJE.gnucash.20200316161155.gnucash";
    "/org/gnucash/history/file8" = "/Users/michaelhendry/Documents/Accounts/RotaryClub.gnucash.20200108210937 copy.gnucash";
    "/org/gnucash/history/file9" = "/Users/michaelhendry/Documents/Accounts/Test_2019-10-26.gnucash";
    "/org/gnucash/history/maxfiles" = 6;

I recently created “TestMRU.gnucash”, the following 4 files are those I regularly use, and the final 5 are not currently in use.

I still get only the 4 most recently opened files in the File menu, so if I want to open MDH.gnucash, I have to use File->Open.

After opening this file, your command yields the following:

 => defaults read -app Gnucash | grep history
    "/org/gnucash/history/file0" = "/Users/michaelhendry/Documents/Accounts/MDH.gnucash";
    "/org/gnucash/history/file1" = "/Users/michaelhendry/Documents/Accounts/TestMRU.gnucash";
    "/org/gnucash/history/file2" = "/Users/michaelhendry/Documents/Accounts/ESJE.gnucash";
    "/org/gnucash/history/file3" = "/Users/michaelhendry/Documents/Accounts/RotaryClub.gnucash";
    "/org/gnucash/history/file4" = "/Users/michaelhendry/Documents/Accounts/RotaryCharity.gnucash";
    "/org/gnucash/history/file5" = "/Users/michaelhendry/Documents/Accounts/CrashTest/A.gnucash";
    "/org/gnucash/history/file6" = "/Users/michaelhendry/Documents/Accounts/CrashTest/B.gnucash";
    "/org/gnucash/history/file7" = "/Users/michaelhendry/Documents/Accounts/ESJE.gnucash.20200316161155.gnucash";
    "/org/gnucash/history/file8" = "/Users/michaelhendry/Documents/Accounts/RotaryClub.gnucash.20200108210937 copy.gnucash";
    "/org/gnucash/history/file9" = "/Users/michaelhendry/Documents/Accounts/Test_2019-10-26.gnucash";
    "/org/gnucash/history/maxfiles" = 6;

…which is as expected.

If there’s another Mac user with more than four files in use, perhaps s/he could report on what after the command:

defaults write -app Gnucash "/org/gnucash/history/maxfiles” 6

(preferably with a before-and-after run of the "defaults read…” command).

Regards,

Michael

PS I noticed that the values associated with the various keys are enclosed in double-quotes, and tried 

defaults write -app Gnucash "/org/gnucash/history/maxfiles” “6”

but the double-quotes don’t appear in the plist.




More information about the gnucash-user mailing list