How open a file without extension ?
I know the type of file.
I'm on a PC.
Sorry for my english
Open a file without extension
Open a file without extension
You need to explain better. Is the file an image? Why no extension?
You have a file: /c/test/photo1.jpg or C:\test\photo1.jpg
In either case, assuming you have Photoshop running, to open:
Code: Select allvar tFileName = '/c/test/photo1.jpg';
var tFile = new File (tFileName);
var tExists = tFile.exists;
if (tExists == false) alert('File ' + tFile.fsName + ' does not exist);
else {
var ok = open(tFile);
if (ok == false) alert('File ' + tFile.fsName + ' did not open);
}
This is not good code but maybe it is easy to understand.
Andrew
You have a file: /c/test/photo1.jpg or C:\test\photo1.jpg
In either case, assuming you have Photoshop running, to open:
Code: Select allvar tFileName = '/c/test/photo1.jpg';
var tFile = new File (tFileName);
var tExists = tFile.exists;
if (tExists == false) alert('File ' + tFile.fsName + ' does not exist);
else {
var ok = open(tFile);
if (ok == false) alert('File ' + tFile.fsName + ' did not open);
}
This is not good code but maybe it is easy to understand.
Andrew
Open a file without extension
The only way it might work is if you know is a jpeg, try using JPEGOpenOptions when you open it. Or just loop through all the different OpenOptions until one of them works.
The alternative is to rename (or copy and rename) the file using different extensions (.jpg, .pdf, .tif, etc...). Try opening each time until you find one that works.
Neither alternative is easy and the first may not even work.
Let us know how it goes.
ciao,
-X
The alternative is to rename (or copy and rename) the file using different extensions (.jpg, .pdf, .tif, etc...). Try opening each time until you find one that works.
Neither alternative is easy and the first may not even work.
Let us know how it goes.
ciao,
-X
Open a file without extension
JPEGOpenOptions don't exist but Photoshop.PsOpenDocumentType.psJPEGOpen exist. But I'don't manage to use this.