Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add undocumented Layer.savePreset(File) method #43

Open
zlovatt opened this issue Oct 15, 2024 · 1 comment
Open

Add undocumented Layer.savePreset(File) method #43

zlovatt opened this issue Oct 15, 2024 · 1 comment

Comments

@zlovatt
Copy link
Member

zlovatt commented Oct 15, 2024

  • Available on all Layer types (not just AVLayer)
  • Added some time after 23.6.9 (see below)
AE Version Available?
23.6.9 no
24.2.1 yes
24.6.2 yes

Would appreciate if others could check more AE builds between the two above to narrow down when it was added.

As an aside, this should also be added into the types-for-adobe project.

@zlovatt zlovatt changed the title Add undocumented Layer.savePreset() method Add undocumented Layer.savePreset(File) method Oct 15, 2024
@zlovatt
Copy link
Member Author

zlovatt commented Oct 15, 2024

Here's a quick lil snippet to check; just run it in your AE version:

(function checkLayerSavePreset () {
  app.beginUndoGroup("Layer.savePreset Version Check");

  var comp = app.project.items.addComp("Test", 4, 4, 1, 1, 24);
  var lyr = comp.layers.addShape();

  var tempFilePath = Folder.desktop.fsName + "/_tempFile.ffx";
  var tempFile = new File(tempFilePath);
  var exists = false;

  try {
    lyr.savePreset(tempFile);
    exists = true;
  } catch (e) {}

  comp.remove();
  tempFile.remove();
  app.endUndoGroup();

  if (exists) {
    alert("Layer.savePreset() exists in " + String(app.version));
  } else {
    alert("Layer.savePreset() does not exist in " + String(app.version));
  }
})();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant