7 Messages
•
160 Points
Sun, Sep 10, 2017 5:44 PM
3
Open "session" feature
I would like Photoshop to have "Session". For example I would be working with 10 files and need to close and do something else. I would had saved that as "Some Session". Next day I would and could open this same session and all files would open up.
Also I didn't find way to choose multiple files from "Recent files" view.
Over and out
Thanks
Also I didn't find way to choose multiple files from "Recent files" view.
Over and out
Thanks
Ideas
•
Updated
3 years ago
0
6
3
Helpful Widget
How can we improve?
Tags
No tags available
Responses
abambo
22 Messages
•
356 Points
3 years ago
0
0
christoph_pfaffenbichler
Champion
•
1.6K Messages
•
25.1K Points
3 years ago
Storing a list of the currently open files and using that data to open them later on could be done with Scripts already. (Edit: provided the files will not have been moved)
The problem is window positions and Viewing parameters.
0
0
jaroslav_bereza
954 Messages
•
15.3K Points
3 years ago
So... it could work if you will not save anything and you kill Photoshop process :-D :-D
0
0
timo_honkanen
7 Messages
•
160 Points
3 years ago
6
0
dale_peters_hpaozpgijma4h
4 Messages
•
100 Points
3 years ago
0
0
christoph_pfaffenbichler
Champion
•
1.6K Messages
•
25.1K Points
3 years ago
// dialog for storing lists of open files and opening files from lists;// 2017; use it at your own risk;
#target photoshop
// get list if txt-file exists;
var thePath = String($.fileName).slice(0, String($.fileName).lastIndexOf("/")) + "/" + "openfiles.txt";
if (File(thePath).exists == true) {
var theText = readPref (thePath);
var theseFiles = theText.split("\r");
var theFiles = new Array;
for (var a = 0; a < theseFiles.length; a++) {theFiles.push(theseFiles[a].split(","))};
}
else {
var theFiles = [["___"]];
};
////////////////////////////////////
var theSelected = selectAThing(theFiles, thePath);
if (theSelected != null) {
var theFails = new Array;
// open files;
for (var m = 1; m < theSelected.length; m++) {
try {app.open(File(theSelected[m]))}
catch (e) {theFails.push(theFiles[m])};
if (theFails.length > 0) {alert ("the following files could not be opened\n"+theFails.join(", "))}
};
};
////////////////////////////////////
////// read prefs file //////
function readPref (thePath) {
if (File(thePath).exists == true) {
var file = File(thePath);
file.open("r");
file.encoding= 'BINARY';
var theText = new String;
for (var m = 0; m < file.length; m ++) {
theText = theText.concat(file.readch());
};
file.close();
return String(theText)
}
};
////// function to write a preference-file storing a text //////
function writePref (theText, thePath) {
try {
var thePrefFile = new File(thePath);
thePrefFile.open("w");
for (var m = 0; m < theText.length; m ++) {
thePrefFile.write(theText[m])
};
thePrefFile.close();
return true
}
catch (e) {return "fail"};
};
////// select dialog //////
function selectAThing (theFiles, thePath) {
var theList = new Array;
for (var m = 0; m < theFiles.length; m++) {
theList.push(theFiles[m][0])
};
var dlg = new Window('dialog', "sessions", [500,300,820,410]);
dlg.pathSel = dlg.add('dropdownlist', [12,13,306,35], (theList));
dlg.pathSel.selection = dlg.pathSel[0];
dlg.deleteBtn = dlg.add('button', [13,42,158,52], 'delete');
dlg.newBtn = dlg.add('button', [168,42,313,52], 'add');
dlg.cancelBtn = dlg.add('button', [13,72,158,82], 'Cancel', {name:'cancel'});
dlg.buildBtn = dlg.add('button', [168,72,313,82], 'OK', {name:'ok'});
////////////////////////////////////
dlg.newBtn. function () {
if (app.documents.length > 0) {
var theNewName = prompt("please enter name");
while (theNewName.indexOf(",")!=-1) {theNewName.replace(",","_")};
// collect fullnames of open images;
var pathArray = new Array;
var unsaved = new Array;
for (var n = 0; n < app.documents.length; n++) {
try {
pathArray.push(app.documents[n].fullName)
}
catch (e) {
app.activeDocument = app.documents[n];
tifOpts = new TiffSaveOptions() ;
tifOpts.embedColorProfile = true;
tifOpts.imageCompression = TIFFEncoding.TIFFLZW;
tifOpts.alphaChannels = true;
tifOpts.byteOrder = ByteOrder.MACOS;
tifOpts.layers = true ;
app.documents[n].saveAs((new File("~/Desktop/"+app.documents[n].name+".tif")), tifOpts, false);
pathArray.push(app.documents[n].fullName);
unsaved.push(app.documents[n].name)
}
};
if (unsaved.length > 0) {alert (unsaved.join(", ")+" seem/s to have been unsaved")};
// write the list;
theFiles.push(theNewName+","+pathArray.join(","));
writePref (theFiles.join("\n"), thePath);
dlg.pathSel.add("item", theNewName)
}
};
////////////////////////////////////
dlg.deleteBtn. function () {
var theNew = new Array;
for (var n = 0; n < theFiles.length; n++) {
if (n != dlg.pathSel.selection.index) {
theNew.push(theFiles[n])
}
};
theFiles = theNew;
dlg.pathSel.remove(dlg.pathSel.selection.index);
dlg.pathSel.selection = dlg.pathSel[0];
writePref (theFiles.join("\r"), thePath);
};
////////////////////////////////////
var myReturn = dlg.show ();
// if ok;
if (myReturn == true) {return theFiles[dlg.pathSel.selection.index]}
else {return null}
};
0
0