docsforadobe / aequery Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Original report by Zack Lovatt (Bitbucket: zlovatt, GitHub: zlovatt).
Original report by Remco Janssen (Bitbucket: [Remco Janssen](https://bitbucket.org/Remco Janssen), ).
Can we delete all the branches besides develop and master?
Original report by Remco Janssen (Bitbucket: [Remco Janssen](https://bitbucket.org/Remco Janssen), ).
It would be great to have some methods that make debugging more pleasant.
For instance logging the actual object to the console instead of object Property
Original report by Remco Janssen (Bitbucket: [Remco Janssen](https://bitbucket.org/Remco Janssen), ).
The Read the Docs
template used on the other aenhancers
docs is great to navigate and the methods and parameters are easy to read. Also for consistency it would therefore be great to have the same type of docs for aeQuery.
A guide to generate RST
from JSDoc
for use with Sphinx
can be found here:
https://jsdoc-toolkit-rst-template.readthedocs.io/en/latest/
Original report by Rune Gangsø (Bitbucket: runegan, GitHub: runegan).
Example:
var win = aeq.ui.createWindow()
win.addButton()
win.addButton()
win.addButton()
aeq.forEach( win.get().children, function( key, value ) {
alert( key + value )
})
This only alerts ones, with the text length3
.
Caused by bad checking of array type in aeq.forEach
Original report by Zack Lovatt (Bitbucket: zlovatt, GitHub: zlovatt).
Right now we have removeChildren
, something to just get the children objects would be great
Original report by Rune Gangsø (Bitbucket: runegan, GitHub: runegan).
I think it would be a good idea to add AEQuery to npm. I got a project where I would like to add AEQuery as a dependency, and that would be best handled through npm.
I was thinking that we could create an npm org, but what should that be called? "aequery", "motiondesign", "aenhancers"? @zlovatt and @Klustre mentioned moving the project to GitHub, but there is already a user there called "motiondesign", so that would't work there.
Also, if aeq-ui is still going to be included as a different file, it should probably be published as its own package, and then probably be in it's own repository. But I think there should be some discussion about why it's included as its own file as I don't really think it need to be.
Anyone got any thoughts on this?
Original report by Rune Gangsø (Bitbucket: runegan, GitHub: runegan).
Right now in aequery there are objects for comps, layers, properties, and keys, none of which are very developed. I think they could be much more useful as submodules, like renderqueue and project, instead of how they are now where you need to create the object before using it.
Original report by Zack Lovatt (Bitbucket: zlovatt, GitHub: zlovatt).
Proposal below; thoughts? Would apply to readFile as well, I think.
#!javascript
writeFile: function(filePath, contents, encoding) {
var file = aeq.getFileObject(filePath);
if (!file.exists) {
var folder = new Folder( file.path );
if ( !folder.exists ) {
folder.create();
}
}
if (!aeq.isNullOrUndefined(encoding))
file.encoding = encoding;
file.open("w");
var success = file.write(contents);
file.close();
return success;
}
Original report by Rune Gangsø (Bitbucket: runegan, GitHub: runegan).
It should be possible to have spaces in attribute values, e.g when trying to get a comp named "Comp 1". It would make most sense to use quotes around the attribute value to distinguish the space from a separator between attributes.
aeq("comp[name='Comp 1']")
Original report by Zack Lovatt (Bitbucket: zlovatt, GitHub: zlovatt).
/**
* Gets selected comps, or all comps if none is selected.
*
* @method
* @memberof aeq
* @return {aeq.arrayEx} ArrayEx of Comp objects
*/
function getSelectedCompsOrAll () {
var comps = aeq.project.getSelectedComps();
if (comps.length == 1)
comps = aeq.arrayEx(comps);
if (aeq.isEmpty(comps))
return aeq.getCompositions();
return comps;
}
Original report by Rune Gangsø (Bitbucket: runegan, GitHub: runegan).
Because the aequery definition is inside a self-invoking function this
refers to the function and not the global object. This is a problem because when using aeq.ui.createMainWindow()
which relies on aeq.thisObj
for knowing if it should create a standalone window or not.
One solution would be to pass this
into the aequery defining function, but that would not work if a user puts #include "aeq.js"
inside a self-invoking function, which is at least what I usually do.
How should this be solved?
Original report by Zack Lovatt (Bitbucket: zlovatt, GitHub: zlovatt).
.addPersistentCheckbox("checkbox text", "prefsKey", onClick, properties)
.addPersistentEditText("default text", "prefsKey", onClick, properties)
So that they'll check the pref on load and update to reflect it, and then after being clicked they'll set the pref and then trigger the rest of the onclick
Original report by Zack Lovatt (Bitbucket: zlovatt, GitHub: zlovatt).
currently:
foo: function (bar) {
bar = bar || {}
}
proposal:
// in a util.js or wherever
isDefined: function (val) {
return typeof val !== "undefined";
}
checkArg: function (val, defaultVal) {
return aeq.isDefined(val) ? val : defaultVal;
}
// then when in use:
foo: function (bar) {
foo = checkArg(bar, {});
}
Original report by Remco Janssen (Bitbucket: [Remco Janssen](https://bitbucket.org/Remco Janssen), ).
Because that's what it does:
Copies the state of layer toggles from one layer to another.
Original report by Zack Lovatt (Bitbucket: zlovatt, GitHub: zlovatt).
I'd like to fix this, but it will break existing tools. Thoughts?
Original report by Zack Lovatt (Bitbucket: zlovatt, GitHub: zlovatt).
We have aeq.getItemsDeep
to create a flat arrayEx of nested items in a folder. Having this for layers in a comp (and precomps) would be good.
Pass in a comp, get a flat arrayEx of all layers in the comp and precomps.
/**
* Returns an arrayEx of all layers in comp and precomps
* @param {CompItem} comp The comp to flatten.
* @return {aeq.arrayEx} ArrayEx with Layer objects.
*/
function getLayersDeep (comp, returnArrayEx) {
// The returnArrayEx param is so we can skip the converting to arrayEx when
// recursing. It is not meant to be used outside of this function.
var layers = [];
aeq.forEachLayer(comp, function (layer) {
if (aeq.isPrecomp(layer))
layers.push.apply(layers, getLayersDeep(layer.source, false));
else
layers.push(layer);
});
// Skip converting to arrayEx when function is called by it self.
if (returnArrayEx === false)
return layers;
return aeq.arrayEx(layers);
}
Original report by Zack Lovatt (Bitbucket: zlovatt, GitHub: zlovatt).
Input:
var root = "\\server\path";
var folder = "foo";
var result = aeq.file.joinPath(root, folder);
Desired output: "\\server\path\foo"
Actual output: "\server\path\foo"
Note: node.path.join()
handles this properly
Original report by Rune Gangsø (Bitbucket: runegan, GitHub: runegan).
I notice that when I write short snippets that it often starts with something like this:
var comp = aeq.getActiveComp()
if ( comp === null ) {
return alert( 'No Comp selected' )
}
var layers = comp.selectedLayers
if ( !layers.length ) {
var applyToAll = confirm( 'No layers selected, apply to all?', false )
if ( applyToAll ) {
layers = aeq.getLayers( comp )
} else {
return
}
}
aeq.undoGroup( 'Undo Group Name', main, [ layers ] )
I think it would be nice to have a function that does all that for you. Something like:
aeq.snippet.selectedOrAllLayers( 'Undo Group Name', function( layers ) {} )
I'm wondering if that is a good solution for it, or if there something else that can be done?
Original report by Rune Gangsø (Bitbucket: runegan, GitHub: runegan).
Is there some way to do unit testing for extendscript? I think it is important to have a way to test all the functions, to make sure there is no errors.
I haven't done any unit testing before, so I am not sure how it should be done. Is there anyone who know how this could be done?
Original report by Zack Lovatt (Bitbucket: zlovatt, GitHub: zlovatt).
The jsdoc comments for these mention options.separate
but don't mention options.props
or options.groups
Original report by Rune Gangsø (Bitbucket: runegan, GitHub: runegan).
There should be a way to get items using the selector:
aeq( "item[typeName='Footage']" )
@vaporstack mentioned filtering by footage type (e.g sequences). I don't know how that would be done, might have to use an additional filter function after calling aeq('...')
, as the selector only looks at attributes of the matched objects.
That might be something worth looking into, defining custom attributes to be used in the selector. For example isSequence
for item types, or parentMatchName
for properties.
Original report by Rune Gangsø (Bitbucket: runegan, GitHub: runegan).
A simple project to showcase different ways to use aequery
Original report by Remco Janssen (Bitbucket: [Remco Janssen](https://bitbucket.org/Remco Janssen), ).
Implement system independent copy-to-clipboard:
#!javascript
function getSystemInfo() {
var info = $.os + " AE " + app.version + "/" + app.isoLanguage;
return info;
}
if (!isWin()) {
system.callSystem('echo "' + getSystemInfo() + '" | pbcopy');
} else {
// shout out to Zlovatt!
var cmdString = 'cmd.exe /c cmd.exe /c "echo ' + myString + ' | clip"';
system.callSystem(cmdString);
}
Original report by Zack Lovatt (Bitbucket: zlovatt, GitHub: zlovatt).
aeq has custom types for 'Property', 'Comp' and 'Layer' (among others). Should some of our get
functions return the aeq types for these, as opposed to native AE elements?
The benefit is that it's easier to integrate into the rest of aeq, or to chain commands. The negative is that it will break existing tools, and that maybe user just wants the native property directly vs the aeq type?
aeq.Property
aeq.getSelectedProperties()
aeq.getProperties()
aeq.getPropertyChildren()
aeq.getMarkerGroup()
aeq.Comp
?aeq.getCompositions()
aeq.getComposition()
aeq.Layer
aeq.getLayers()
aeq.getSelectedLayers()
aeq.getSelectedLayersOrAll()
Original report by Rune Gangsø (Bitbucket: runegan, GitHub: runegan).
Ability to get effects by doing
aeq("effect")
Original report by Rune Gangsø (Bitbucket: runegan, GitHub: runegan).
It should pass all arguments to the getItems
function.
Original report by Rune Gangsø (Bitbucket: runegan, GitHub: runegan).
It's confusing to have multiple file.js files.
The exported functions should stay the same, so there is no breaking changes.
Original report by Zack Lovatt (Bitbucket: zlovatt, GitHub: zlovatt).
getPropertyChildren accepts an options object for separate
and groups
-- forEachProperty
should accept this, too.
forEachProperty: function(obj, callback, options)
Original report by Rune Gangsø (Bitbucket: runegan, GitHub: runegan).
How to use aequery
Original report by vaporstack (Bitbucket: vaporstack, GitHub: vaporstack).
I'm not sure if this is easy or possible, but supplying default values "ok" "cancel" to an ESTK dialog will automatically dismiss it with the correct return value, it might be a useful convenience to provide similar functionality for createDialog? Not sure how this is implemented internally in ScriptUI but maybe worth thinking about.
Original report by Remco Janssen (Bitbucket: [Remco Janssen](https://bitbucket.org/Remco Janssen), ).
Add deployment tasks for earlier versions of AE
Original report by Rune Gangsø (Bitbucket: runegan, GitHub: runegan).
It would be handy to have a way to set custom build locations for the gulp build. When working on a project and at the same time working on aequery, it would be nice if built itself right into that project.
I don't know much about gulp so don't know how to best implement this. Anybody else think this would be useful?
Original report by vaporstack (Bitbucket: vaporstack, GitHub: vaporstack).
There are a couple of minor inconsistencies in the casing of ui/container.js -
Notably, AddEditText / AddStatictext have dissimilar casing. Easy enough to fix but probably should be done with a deprecation warning to avoid breaking existing scripts.
Recommend we use the naming and casing as described in JavaScript Tools Guide -
* AddStatictext -> AddStaticText
* AddTreeview -> AddTreeView
* AddListbox -> AddListBox* *
A little bit annoying to decipher since the tools guide has some inconsistencies in itself, for example
#!javascript
ProgressBar / Scrollbar
Original report by Rune Gangsø (Bitbucket: runegan, GitHub: runegan).
Add the possibility of getting objects by matching attributes based on a regular expression.
For Example: aeq("com[name=/main/i]")
would return all comps with names containing "main".
Would this be a useful feature?
Original report by Rune Gangsø (Bitbucket: runegan, GitHub: runegan).
When doing aeq("comp")
to get all comps you get "SyntaxError: expected '[' or [a-zA-Z] but end of input found"
Original report by Remco Janssen (Bitbucket: [Remco Janssen](https://bitbucket.org/Remco Janssen), ).
Perhaps we can add some of the ES6 string methods? Includes() would be very handy.
Original report by Rune Gangsø (Bitbucket: runegan, GitHub: runegan).
Currently you have to this:
forEach( item.usedIn, function ( comp ) {
forEach( comp, function ( layer ) {
if ( layer.source === item )
// Do something
})
})
It would be nice have something like this:
var layers = aeq.getItemLayers( item )
Original report by Remco Janssen (Bitbucket: [Remco Janssen](https://bitbucket.org/Remco Janssen), ).
For future contributors…
Original report by vaporstack (Bitbucket: vaporstack, GitHub: vaporstack).
I've #imported the file and my life is exactly the same as it was before.
Original report by Zack Lovatt (Bitbucket: zlovatt, GitHub: zlovatt).
Something like this--
#!javascript
/**
* Takes a comp and finds it as a precomp layer in other comps
*
* @param {CompItem} comp Comp find as layers
* @returns {Layer[]} Array of layers whose source matches target comp
*/
function findCompAsLayers (comp) {
var compAsLayers = aeq.arrayEx();
var compUsedInArray = aeq.arrayEx(comp.usedIn);
if (aeq.isEmpty(compUsedInArray))
return;
aeq.forEach(compUsedInArray, function (usedInComp) {
var usedInCompLayers = aeq.arrayEx(aeq.normalizeCollection(usedInComp.layers));
var matchingLayers = usedInCompLayers.filter(function (layer) {
return layer.source == comp;
});
compAsLayers = compAsLayers.concat(matchingLayers);
})
return compAsLayers;
}
Original report by Remco Janssen (Bitbucket: [Remco Janssen](https://bitbucket.org/Remco Janssen), ).
Add possibility to change custom label colors. Snippet available from Kyle Martinez.
Original report by Remco Janssen (Bitbucket: [Remco Janssen](https://bitbucket.org/Remco Janssen), ).
Add a watch task for the libs folder.
Original report by Zack Lovatt (Bitbucket: zlovatt, GitHub: zlovatt).
Based on this by @rafikhan, adapted from something by @rendertom
Needs to be aequery-ified, and implemented as aeq.file.selectFiles();
var myFiles = selectFiles(["jsx", "theme", "someOtherExtension"], true);
function selectFiles(extensionList, multiSelect)
{
var message = multiSelect ? "Please select multiple files" : "Please select file";
var getFilterForFiles = function ()
{
var isWindows = ($.os.indexOf("Windows") != -1);
if (isWindows) {
return '*.' + extensionList.join(';*.');
} else {
var extensionListRe = '\.(' + extensionList.join('|') + ')$';
var re = new RegExp(extensionListRe, "i");
return function (file) {
return file.name.match(re) || file.constructor.name === "Folder";
};
}
}
return File.openDialog(message, getFilterForFiles(), multiSelect);
}
Original report by Rune Gangsø (Bitbucket: runegan, GitHub: runegan).
Currently if an error is thrown when importing multiple files with aeq.project.importFiles the import is stopped and no items, some of which could have been imported successfully, is not returned. I think it would be better to gather the errors, and let all items be imported.
The problem then becomes: what to do with the errors?
My ideal solution would be something where the items that was imported still gets returned, as I probably want to do something with them, but I still get to control what to do with the errors.
Some solutions:
{ items, errors }
errors
attribute to the return arrayif ( item instanceof Error )
for all items the array before doing what you intend.Original report by Remco Janssen (Bitbucket: [Remco Janssen](https://bitbucket.org/Remco Janssen), ).
Warning: 80:14 warning Function has a complexity of 38 complexity
Original report by Remco Janssen (Bitbucket: [Remco Janssen](https://bitbucket.org/Remco Janssen), ).
Not sure why this is a problem. Should this be converted to an options object?
Warning: 297:13 warning Method 'addSlider' has too many parameters (5). Maximum allowed is 4 max-params
Original report by Zack Lovatt (Bitbucket: zlovatt, GitHub: zlovatt).
Something like this? Or as a flag to the existing aeq.file.getFiles()
function
/**
* Recursively scan folder for all files matching extension
*
* @param {Folder} folder Root folder to serach in
* @param {string} extension File extension to search
* @returns {File[]} Array of found files
*/
function recursiveGetFiles (folder, extension) {
var foundItems = aeq.arrayEx();
var folderObject = aeq.file.getFolder(folder);
if (aeq.isNullOrUndefined(folderObject))
return foundItems;
var items = aeq.file.getFiles(folderObject);
if (aeq.isNullOrUndefined(items))
return foundItems;
items.forEach(function (item) {
if (aeq.isFolder(item)) {
foundItems = foundItems.concat(recursiveGetFiles(item, extension));
} else if (aeq.file.getExtension(item) === extension){
foundItems.push(item);
}
});
return foundItems;
}
Original report by Zack Lovatt (Bitbucket: zlovatt, GitHub: zlovatt).
function copyMultilineStringToClipboard (text) {
var escapedText = text.split("\n").join("&echo.").split(")").join("^^^)")
var cmdString = 'cmd.exe /c cmd.exe /c "(echo ' + escapedText + ') | clip"';
return system.callSystem(cmdString);
}
Original report by Remco Janssen (Bitbucket: [Remco Janssen](https://bitbucket.org/Remco Janssen), ).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.