• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

open tif file

Engaged ,
Feb 18, 2019 Feb 18, 2019

Copy link to clipboard

Copied

Hello everyone,

I have this script that saves a tif file. It adds "NEWFILE" at the end of the filename in the same path.

whenever I run the script in Photoshop it  works and saves the document in the folder and now i have 2 files in my folder, the original one and another one that is with NEW in the end, the file that is in Photoshop isn't the one I've just saved.

I want to open the file I've just saved in Photoshop, how do I open it?

#target photoshop  

    main();  

     

     

    function main(){  

    if(!documents.length) return;  

    var Name = app.activeDocument.name.replace(/\.[^\.]+$/, '');  

  

    try{ var savePath = activeDocument.path; } 

    catch(e){  

    savePath = Folder.selectDialog("select folder");

    alert("You must save this document first!\nTo establish a save path..."); 

    return 

        }  

    var fileList= savePath.getFiles(Name +"*.tif").sort().reverse();  

   

   

   var saveName = File(savePath + "/" + Name + "NEWFILE") 

  SaveTIFF(saveName);    

    }

   

   

    ////////////////////////////////////////////////////////////////////////////////////////////////// 

    function zeroPad(n, s) {   

       n = n.toString();   

       while (n.length < s)  n = '0' + n;   

       return n;   

    };      

    function SavePSD(saveFile){   

    psdSaveOptions = new PhotoshopSaveOptions();   

    psdSaveOptions.embedColorProfile = true;   

    psdSaveOptions.alphaChannels = true;    

    psdSaveOptions.layers = true;    

    activeDocument.saveAs(saveFile, psdSaveOptions, true, Extension.LOWERCASE);   

    };  

   

    function SaveTIFF(saveFile){ 

tiffSaveOptions = new TiffSaveOptions();  

tiffSaveOptions.embedColorProfile = true;  

tiffSaveOptions.alphaChannels = true;  

tiffSaveOptions.layers = true; 

tiffSaveOptions.imageCompression = TIFFEncoding.NONE; 

//tiffSaveOptions.jpegQuality=10; 

activeDocument.saveAs(saveFile, tiffSaveOptions, true, Extension.LOWERCASE);  

TOPICS
Actions and scripting

Views

617

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Feb 19, 2019 Feb 19, 2019

Found solution:

var myNewFile = File(saveName + ".tif");        //saveName contains the path and the file name (file extension not included so i added it)

open(myNewFile);

Votes

Translate

Translate
Adobe
Engaged ,
Feb 19, 2019 Feb 19, 2019

Copy link to clipboard

Copied

LATEST

Found solution:

var myNewFile = File(saveName + ".tif");        //saveName contains the path and the file name (file extension not included so i added it)

open(myNewFile);

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines