Copy link to clipboard
Copied
I'm currently working on a lookup and recoding of AE color information, like so many before me:
https://community.adobe.com/t5/after-effects-discussions/set-new-default-solids-folder-with-javascri...
https://community.adobe.com/t5/after-effects-discussions/get-label-colors-from-pref/m-p/7716338
https://community.adobe.com/t5/after-effects-discussions/read-and-modify-ae-preferences/m-p/5229040
Because of all the problems the getPrefsAsAntything() approach brings with it, I'm also doing the suggested workaround with the selfbuilt encoder and line by line reading of the txt. How to do that is not the problem, I've got that covered. But what I'm looking for atm is how to find the correct indep-general file.
Is there a way to let AE tell me what prefs file its currently using? Something like app.project.file.fsName, but for the indep-general? I want to avoid any problems with special notations of the filename, e.g. a french "Préfs". And also to exlude the possibility that e.g. the system folder is not on C: on Windows and so on.
Copy link to clipboard
Copied
Unfortunately there's not an easy way to get the prefs filepath from AE. Instead, you need to build it on your own and then read the file.
Mac: users/[username]/Library/Preferences/Adobe/After Effects/[version]/
Win: C:\Users\[username]\AppData\Roaming\Adobe\After Effects\[version]\
And since the names can change per region (the word "Prefs"), just look for the latest modified files starting with "Adobe After Effects" and ending with the specific prefs file ending "-indep-render.txt", "-indep-general.txt", etc.
Copy link to clipboard
Copied
Now that's really smart to look for the latest modified file. I've been always just checking for all kinds of "Prefs" translations which seems somewhat unreliable since I was also missing some translations. Thanks! 🙂
Copy link to clipboard
Copied
Sure thing, yea finding the latest version solves a bunch of issues.
Copy link to clipboard
Copied
Neat Idea justin 🙂
Already found it in the API, now I jsut have to include it in my code. thx!
https://extendscript.docsforadobe.dev/file-system-access/file-object.html#file-class-properties
Copy link to clipboard
Copied
nice!
Copy link to clipboard
Copied
In case anybody else runs into this issue:
I just noticed that when you run Ae the very first time, the preferences files may not exist, yet, and will only be created after you close Ae the first time. So if the files cannot be found, you might want to show a message saying that if Ae has been launched the very first time you need to restart it.
Copy link to clipboard
Copied
Good to know 👍