1K Messages
•
17.1K Points
Mon, Jul 30, 2018 4:35 PM
3
Bridge: Ability to export folder listing to text file
Not sure why file management apps don't have functionality to export a folder listing to a text file. Consider this a feature request.
I've also written a quick and dirty script to do this. If you've ever needed this functionality, here ya go. Much easier than the old Batch Rename workaround.
As-is, use at your own risk, no warranty, your mileage may vary, etc. Apache licensed so its Free Software.
Let me know if it doesn't work, I haven't tested on the Mac yet. It will be slow on large folders but I have tested on a folder with 12,000+ items and it worked fine.
/*
FolderListExport created by David M. Converse ©2018. http://www.lumigraphics.com
Last updated 7-30-2018
This script uses Extendscript and ScriptUI to save a text list of the currently selected folder in Bridge.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#target bridge
if(BridgeTalk.appName == 'bridge'){
var newCommand = new MenuElement('command', 'Export Folder List...', 'at the end of Tools');
}
newCommand.function (){
FolderListExport();
}
function FolderListExport(){
var FileList = [];
var items = 0;
var parentFolder = new Thumbnail(app.document.presentationPath);
var logPath = '';
var logFile = File(logPath);
if(parentFolder.container){
try{
app.synchronousMode = true;
parentFolder.refresh();
FileList = parentFolder.children;
items = FileList.length;
if(items == 0) return;
logFile = new File('~/Desktop/' + parentFolder.name + '.txt').saveDlg('Create New Log File', '*.txt');
logFile.open('w:');
for(var i = 0;i < items;i++){
logFile.writeln(FileList[i].name);
}
logFile.close();
app.synchronousMode = false;
}
catch(e){
alert('Folder list not saved.');
}
}
else{
alert('Please select a folder. Collections are not supported.');
return;
}
}
I've also written a quick and dirty script to do this. If you've ever needed this functionality, here ya go. Much easier than the old Batch Rename workaround.
As-is, use at your own risk, no warranty, your mileage may vary, etc. Apache licensed so its Free Software.
Let me know if it doesn't work, I haven't tested on the Mac yet. It will be slow on large folders but I have tested on a folder with 12,000+ items and it worked fine.
/*
FolderListExport created by David M. Converse ©2018. http://www.lumigraphics.com
Last updated 7-30-2018
This script uses Extendscript and ScriptUI to save a text list of the currently selected folder in Bridge.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#target bridge
if(BridgeTalk.appName == 'bridge'){
var newCommand = new MenuElement('command', 'Export Folder List...', 'at the end of Tools');
}
newCommand.function (){
FolderListExport();
}
function FolderListExport(){
var FileList = [];
var items = 0;
var parentFolder = new Thumbnail(app.document.presentationPath);
var logPath = '';
var logFile = File(logPath);
if(parentFolder.container){
try{
app.synchronousMode = true;
parentFolder.refresh();
FileList = parentFolder.children;
items = FileList.length;
if(items == 0) return;
logFile = new File('~/Desktop/' + parentFolder.name + '.txt').saveDlg('Create New Log File', '*.txt');
logFile.open('w:');
for(var i = 0;i < items;i++){
logFile.writeln(FileList[i].name);
}
logFile.close();
app.synchronousMode = false;
}
catch(e){
alert('Folder list not saved.');
}
}
else{
alert('Please select a folder. Collections are not supported.');
return;
}
}
Ideas
•
Updated
2 years ago
92
10
3
Helpful Widget
How can we improve?
Tags
No tags available
Responses
lumigraphics
1K Messages
•
17.1K Points
2 years ago
Select a folder and then that menu command. Choose the file location and the script will save your folder listing.
0
0
x3dgime
22 Messages
•
528 Points
2 years ago
0
0
lumigraphics
1K Messages
•
17.1K Points
2 years ago
And choosing a file location in a standard dialog is MUCH easier than figuring out a path to paste in.
Hmm?
0
0
lumigraphics
1K Messages
•
17.1K Points
2 years ago
0
0
kenbarber_3530211
47 Messages
•
780 Points
2 years ago
0
0
lumigraphics
1K Messages
•
17.1K Points
2 years ago
So, no, its not simple. You've apparently never supported or worked with non-technical designers. Just because you and I are proficient on the command line doesn't mean that anyone else is.
0
0
kenbarber_3530211
47 Messages
•
780 Points
2 years ago
5
0
lumigraphics
1K Messages
•
17.1K Points
2 years ago
Same directions to install and use.
------------------------------------------------
/*
FolderListExport created by David M. Converse ©2018
www.lumigraphics.com
Last updated 8-1-2018
This script uses Extendscript and ScriptUI to save a text list of the currently selected folder or collection in Bridge.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#target bridge
if(BridgeTalk.appName == 'bridge'){
var newCommand = new MenuElement('command', 'Export Folder List...', 'at the end of Tools');
}
newCommand.function (){
FolderListExport();
}
function FolderListExport(){
var FileList = [];
var CollList = [];
try{
if(app.document.presentationPath){
var parentFolder = new Thumbnail(app.document.presentationPath);
}
else{
alert('Expanded subfolder listing is not currently supported, sorry.');
return;
}
app.synchronousMode = true;
parentFolder.refresh();
if(parentFolder.container){
FileList = parentFolder.children;
}
else{
CollList = app.getCollections();
for(var j=0;j < CollList.length; j++){
if((CollList[j].name + '.filelist') == parentFolder.name){
FileList = app.getCollectionMembers(CollList[j]);
break;
}
}
}
if(FileList.length == 0) return;
fileWriter(FileList, parentFolder);
app.synchronousMode = false;
}
catch(e){
alert('List not saved.');
return;
}
}
function fileWriter(FileList, parentFolder){
var logPath = '';
var logFile = File(logPath);
var listing = '';
var numHidden = 0;
var txtHidden = '';
try{
numHidden = FileList.length - app.document.visibleThumbnailsLength;
if(numHidden != 0){
txtHidden = ', ' + numHidden + ' Hidden';
}
listing = parentFolder.name;
if(! parentFolder.container){
listing = parentFolder.name.split('.');
if(listing.length > 1){
listing.length--;
}
listing = listing.join('.') + ' Collection';
}
logFile = new File('~/Desktop/' + listing + '.txt').saveDlg('Create New Log File', '*.txt');
logFile.open('w:');
if(parentFolder.container){
logFile.writeln(parentFolder.spec.fullName);
}
else{
logFile.writeln(listing);
}
logFile.writeln(app.document.visibleThumbnailsLength + ' Items' + txtHidden + '.\r\r');
for(var i = 0;i < FileList.length;i++){
listing = FileList[i].name;
if(FileList[i].container){
listing = listing + ' (Folder)';
}
if(! FileList[i].hidden || numHidden == 0){
logFile.writeln(listing);
}
}
logFile.close();
}
catch(e){
alert('Could not save listing.');
return;
}
}
20
Stephen_A_Marsh
114 Messages
•
1.8K Points
2 years ago
http://prepression.blogspot.com/2016/12/automator-diy-exiftool-gui-services.html
0
0
lumigraphics
1K Messages
•
17.1K Points
2 years ago
I could easily write an AppleScript and a Powershell script to do this, but not inside of Bridge and not with the integration.
Most people cannot program, simple fact. And your suggestion is off-topic because this is about a solution for BRIDGE on both Windows and Mac.
4
0