How do I get the path to the Preferences folder?

Posted on
Thu Jan 02, 2020 8:39 pm
ZachBenz offline
Posts: 163
Joined: Feb 08, 2014

How do I get the path to the Preferences folder?

I'm looking to save a file (an access token cache) in a place that doesn't get overwritten when my plugin (RingForIndigo) is updated. Seems like the Preferences folder is the right place to do this (i.e. /Library/Application Support/Perceptive Automation/Indigo 7.x/Preferences).

To get this path, is it appropriate to simply append "/Preferences" to indigo.server.getInstallFolderPath()?

ZachBenz's Plugins: RingForIndigo

Posted on
Thu Jan 02, 2020 9:47 pm
ZachBenz offline
Posts: 163
Joined: Feb 08, 2014

Re: How do I get the path to the Preferences folder?

Slight edit: appropriate to simply append "Preferences/Plugins"?

ZachBenz's Plugins: RingForIndigo

Posted on
Fri Jan 03, 2020 3:08 am
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: How do I get the path to the Preferences folder?

Your concept is sound, so assuming all the folder paths and the Indigo function is correct, then yes, that’s the way to do it (and is how I do it).


Sent from my iPhone using Tapatalk Pro

Posted on
Fri Jan 03, 2020 8:32 am
ZachBenz offline
Posts: 163
Joined: Feb 08, 2014

Re: How do I get the path to the Preferences folder?

Thanks!

ZachBenz's Plugins: RingForIndigo

Posted on
Fri Jan 03, 2020 2:50 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: How do I get the path to the Preferences folder?

I agree with howartp. Another option would be to just encode the file into a string and store it in your plugin's pluginPrefs dict. Presuming it isn't huge that should work fine.

Image

Posted on
Fri Jan 03, 2020 2:50 pm
ZachBenz offline
Posts: 163
Joined: Feb 08, 2014

Re: How do I get the path to the Preferences folder?

Thanks, Matt.

ZachBenz's Plugins: RingForIndigo

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 4 guests