...
For example, to count all PNG files stored in the entire Data Team project or to sum their sizes you would run, respectively:
Code Block |
---|
asset.query :wherenamespace "namespace>='/projects/Data Team' and myproject" :where "name='*.PNG'" :action count asset.query :wherenamespace "namespace>='/projects/Data Team' and myproject" :where "name='*.PNG'" :action sum :xpath content/size |
...
For example, suppose we wanted to move all PNG files to a new location /projects/Data Teammyproject/png-files we would use:
Code Block |
---|
asset.query :wherenamespace "namespace>='/projects/Data Team' and myproject" :where "name='*.PNG'" :action pipe :service -name asset.move < :namespace /projects/Data Teammyproject/png-files > |
Here our action is to pipe the results to another service call, in this case an asset.move, which is a service call that takes the required destination namespace argument in a shorthand XML document.
Naturally, similar constructions could be used to simply delete these files instead:
Code Block |
---|
asset.query :wherenamespace "namespace>='/projects/Data Team' and myproject" :where "name='*.PNG'" :action pipe :service -name asset.destroy |
...