It is maybe worth mentioning that the Gnucash preferences plist on Mac OS is 
stored in:
~/Library/Preferences/org.gnucash.Gnucash.plist

Will


On 2021 Jan 18, at 01-18 12:55:51, John Ralls <jra...@ceridwen.us> wrote:

And that turns out to be necessary: Unless you tell defaults -int it writes a 
string and GSettings decides that's the wrong type and won't use it.

Incidentally, someone wondered how to do this on other OSes. In Linux you'd 
just use the DConf tool to create the key /org/gnucash/history/maxfiles. In 
Windows you must use Regedit. Find the key 
Computer\HKEY_CURRENT_USER\SOFTWARE\GSettings\org\gnucash\history and add to it 
a DWord value named maxfiles and set it to whatever value you like between 0 
and 10.

I've updated 
https://wiki.gnucash.org/wiki/FAQ#Q:_I_have_deleted_a_gnucash_file_from_my_computer._How_can_I_remove_that_file_from_the_File_menu.27s_short_list_.28MRU.29_as_well.3F
 with those instructions.

Regards,
John Ralls

> On Jan 18, 2021, at 8:32 AM, Chris Graves <mohaveba...@gmail.com> wrote:
> 
> If you open the plist file with Xcode or bbedit or ... you may see that the 
> maxfiles key is of type string, instead of integer.  It may look like:
>       <key>/org/gnucash/history/maxfiles</key>
>       <string>6</string>
> 
> Instead of
>       <key>/org/gnucash/history/maxfiles</key>
>       <integer>6</integer>
> 
> You can manually change string to integer or do this:
> defaults delete -app Gnucash "/org/gnucash/history/maxfiles"
> defaults write -app Gnucash "/org/gnucash/history/maxfiles" -int 6
> 
> 
>> On Jan 18, 2021, at 2:20 AM, Michael Hendry <hendry.mich...@gmail.com> wrote:
>> 
>>> On 17 Jan 2021, at 20:11, David H <hell...@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.
>> 
>> 
>> _______________________________________________
>> gnucash-user mailing list
>> gnucash-user@gnucash.org
>> To update your subscription preferences or to unsubscribe:
>> https://lists.gnucash.org/mailman/listinfo/gnucash-user
>> If you are using Nabble or Gmane, please see 
>> https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
>> -----
>> Please remember to CC this list on all your replies.
>> You can do this by using Reply-To-List or Reply-All.
> 
> _______________________________________________
> gnucash-user mailing list
> gnucash-user@gnucash.org
> To update your subscription preferences or to unsubscribe:
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> If you are using Nabble or Gmane, please see 
> https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.

_______________________________________________
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.

_______________________________________________
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.

Reply via email to