Files and Folders
Opened this issue · 2 comments
louwjlabuschagne commented
- File and Folder paths
- Import files into file type bins
- CSV import. Cut at times in CSV and add markers with comment
- Open Word or application, After Effects execute script and Photoshop file open from Premiere Pro
Video tutorial that builds upon https://premiereonscript.com/log-10/ using:
var importSingleFile = File.openDialog ("Import Video File");
var importAry = [];
importAry.push(importSingleFile.fsName);
app.project.importFiles(importAry);
and
var filterString = "*.*"
var importManyFiles = File.openDialog("Import Files", filterString, true);
var importAry = [];
if (importManyFiles) {
for (var i = 0; i < importManyFiles.length; i++) {
importAry[i] = importManyFiles[i].fsName;
}
}
app.project.importFiles(importAry, 1, app.project.rootItem, 0);
The main abilities of the tutorial should be:
- where does File.openDialog come from with reference to §3 in https://www.adobe.com/content/dam/acom/en/devnet/scripting/estk/javascript_tools_guide.pdf
- File object p47
- Folder object p56
- the difference between Windows and Mac file path formats
- what are URIs and how to use them
- absolute vs relative paths
- filtering the selected file array in ExtendScript
- idea
copy()
highlight all items on timeline and copy them to another folder - idea
execute()
assign a shortcut to a file/application you want to open from within PP
louwjlabuschagne commented
{
"extension": {
"version": "1.3.5",
"groupOrder": [
["Custom ExtendScript"]
]
},
"automations": [{
"uid": 5,
"automation": "Execute Custom ExtendScript",
"args": [{
"key": "executeCustomExtendScriptScript",
"value": "(new File(\"/Users/louwjlab/Pictures\")).execute()",
"label": "Script"
}],
"summary": "Open Pictures",
"description": "Script: (new File(\"/Users/louwjl\nab/Pictures\")).execute()\n",
"group": "Custom ExtendScript",
"tags": ["Auto Edit"],
"keyboardEvent": {
"altKey": false,
"ctrlKey": false,
"metaKey": false,
"shiftKey": false,
"keyCode": 80,
"code": "KeyP"
},
"isBig": false
}, {
"uid": 4,
"automation": "Execute Custom ExtendScript",
"args": [{
"key": "executeCustomExtendScriptScript",
"value": "(new File(\"/Applications/Microsoft\\ Word.app\")).execute()",
"label": "Script"
}],
"summary": "Open MS word",
"description": "Script: (new File(\"/Applications\n/Microsoft\\ Word.app\")).execute(\n)\n",
"group": "Custom ExtendScript",
"tags": ["Auto Edit"],
"keyboardEvent": {
"altKey": false,
"ctrlKey": false,
"metaKey": false,
"shiftKey": false,
"keyCode": 87,
"code": "KeyW"
},
"isBig": false
}, {
"uid": 3,
"automation": "Execute Custom ExtendScript",
"args": [{
"key": "executeCustomExtendScriptScript",
"value": "var importManyFiles = File.openDialog(\"Import Files\",\"*.*\", true);\nvar importAry = [];\n\nif (importManyFiles) {\n for (var i = 0; i < importManyFiles.length; i++) {\n importAry[i] = importManyFiles[i].fsName;\n }\n}\n\napp.project.importFiles(importAry, 1, app.project.rootItem, 0);",
"label": "Script"
}],
"summary": "Import Files",
"description": "Script: var importManyFiles = Fi\nle.openDialog(\"Import Files\",\"*.\n*\", true);\nvar importAry = [];\n\n\nif (importManyFiles) {\n for (\nvar i = 0; i < importManyFiles.l\nength; i++) {\n importAry[\ni] = importManyFiles[i].fsName;\n\n }\n}\n\napp.project.importFiles\n(importAry, 1, app.project.rootI\ntem, 0);\n",
"group": "Custom ExtendScript",
"tags": ["Auto Edit"],
"keyboardEvent": {
"altKey": false,
"ctrlKey": false,
"metaKey": false,
"shiftKey": true,
"keyCode": 73,
"code": "KeyI"
},
"isBig": false
}, {
"uid": 6,
"automation": "Execute Custom ExtendScript",
"args": [{
"key": "executeCustomExtendScriptScript",
"value": "var importSingleFile = File.openDialog (\"Import Video File\");\nvar importAry = [];\nimportAry.push(importSingleFile.fsName);\napp.project.importFiles(importAry);",
"label": "Script"
}],
"summary": "Import File",
"description": "Script: var importSingleFile = F\nile.openDialog (\"Import Video Fi\nle\");\nvar importAry = [];\nimport\nAry.push(importSingleFile.fsName\n);\napp.project.importFiles(impor\ntAry);\n",
"group": "Custom ExtendScript",
"tags": ["Auto Edit"],
"keyboardEvent": {
"altKey": false,
"ctrlKey": false,
"metaKey": false,
"shiftKey": false,
"keyCode": 73,
"code": "KeyI"
},
"isBig": false
}, {
"uid": 7,
"automation": "Execute Custom ExtendScript",
"args": [{
"key": "executeCustomExtendScriptScript",
"value": "(new Folder(\"/Users/louwjlab/Pictures/asdf\")).rename(\"fdsa\")",
"label": "Script"
}],
"summary": "Rename Folder",
"description": "Script: (new Folder(\"/Users/louw\njlab/Pictures/asdf\")).rename(\"fd\nsa\")\n",
"group": "Custom ExtendScript",
"tags": ["Auto Edit"],
"keyboardEvent": {
"altKey": false,
"ctrlKey": false,
"metaKey": false,
"shiftKey": false,
"keyCode": 82,
"code": "KeyR"
},
"isBig": false
}, {
"uid": 9,
"automation": "Execute Custom ExtendScript",
"args": [{
"key": "executeCustomExtendScriptScript",
"value": "photoshop.executeScript(\"alert('Howdey')\")",
"label": "Script"
}],
"summary": "Execute alert on photoshop",
"description": "Script: photoshop.executeScript(\n\"alert('Howdey')\")\n",
"group": "Custom ExtendScript",
"tags": ["Auto Edit"],
"keyboardEvent": {
"altKey": false,
"ctrlKey": false,
"metaKey": false,
"shiftKey": false,
"keyCode": 50,
"code": "Digit2"
},
"isBig": false
}, {
"uid": 8,
"automation": "Execute Custom ExtendScript",
"args": [{
"key": "executeCustomExtendScriptScript",
"value": "photoshop.open(new File(\"/Users/louwjlab/Downloads/posters/Poster\\ 1.psd\"))",
"label": "Script"
}],
"summary": "Open Photoshop",
"description": "Script: photoshop.open(new File(\n\"/Users/louwjlab/Downloads/poste\nrs/Poster\\ 1.psd\"))\n",
"group": "Custom ExtendScript",
"tags": ["Auto Edit"],
"keyboardEvent": {
"altKey": false,
"ctrlKey": false,
"metaKey": false,
"shiftKey": false,
"keyCode": 49,
"code": "Digit1"
},
"isBig": false
}, {
"uid": 10,
"automation": "Execute Custom ExtendScript",
"args": [{
"key": "executeCustomExtendScriptScript",
"value": "alert(JSON.stringify($.screens))",
"label": "Script"
}],
"summary": "Screens",
"description": "Script: alert(JSON.stringify($.s\ncreens))\n",
"group": "Custom ExtendScript",
"tags": ["Auto Edit"],
"keyboardEvent": {
"altKey": false,
"ctrlKey": false,
"metaKey": false,
"shiftKey": false,
"keyCode": 51,
"code": "Digit3"
},
"isBig": false
}, {
"uid": 11,
"automation": "Execute Custom ExtendScript",
"args": [{
"key": "executeCustomExtendScriptScript",
"value": "$.colorPicker()",
"label": "Script"
}],
"summary": "Color Picker",
"description": "Script: $.colorPicker()\n",
"group": "Custom ExtendScript",
"tags": ["Auto Edit"],
"keyboardEvent": {
"altKey": false,
"ctrlKey": false,
"metaKey": false,
"shiftKey": false,
"keyCode": 52,
"code": "Digit4"
},
"isBig": false
}]
}
louwjlabuschagne commented
- File and Folder paths
- Import files into file type bins
- CSV import. Cut at times in CSV and add markers with comment
- Open Word or application, After Effects execute script and Photoshop file open from Premiere Pro