Skip to content

Commit 309b428

Browse files
committed
Add 'Get Selected File Paths'
1 parent 73275fa commit 309b428

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

Get Selected File Paths.jsx

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* Gets file paths of selected files in the project panel
3+
*
4+
* @author Zack Lovatt <[email protected]>
5+
* @version 0.1.0
6+
*/
7+
(function getSelectedFilePaths () {
8+
var items = app.project.selection;
9+
10+
if (items.length === 0) {
11+
return;
12+
}
13+
14+
var paths = [];
15+
16+
for (var ii = 0, il = items.length; ii < il; ii++) {
17+
var item = items[ii];
18+
19+
if (!(item instanceof FootageItem)) {
20+
return;
21+
}
22+
23+
var source = item.mainSource;
24+
25+
if (!(source instanceof FileSource)) {
26+
return;
27+
}
28+
29+
paths.push(item.file.fullName);
30+
}
31+
32+
alert(paths.join("\n"));
33+
})();

readme.md

+19
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,25 @@ If run as a ScriptUI Panel (if installed in AE), you can dock the panel to get v
362362

363363
---
364364

365+
<div>
366+
<div>
367+
<div>
368+
<div>
369+
370+
#### [Get Selected File Paths](https://raw.githubusercontent.com/zlovatt/zl_Scriptlets/master/Get&#32;Selected&#32;File&#32;Paths.jsx)
371+
372+
</div>
373+
<div>
374+
375+
Gets file paths of selected files in the project panel.
376+
377+
</div>
378+
</div>
379+
</div>
380+
</div>
381+
382+
---
383+
365384
<div>
366385
<div>
367386
<div>

0 commit comments

Comments
 (0)