File.saveDialog, Win7, read-only files...

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

TedB

File.saveDialog, Win7, read-only files...

Post by TedB »

I am trying to make use of File.saveDialog. I developed the script for Photoshop CS4, on Win XP. One user recently upgraded to Win7, and the behavior of the dialog seems to have changed. With XP, if the user selects a read-only file, there's no problem, but with Win7 it reports "This file is set to read-only. Try again with a different file name." I am hoping someone reading this will have an idea that might help me resolve this issue.

The code looks like this:
Code: Select all    // Ask the user for a filename to save the TGA to.
    var suggestedFile = new File("/c/dev/project/sample.tga");
    var targetFile = suggestedFile.saveDlg("Where would you like to save this texture?", "*.tga");


The file will usually be read-only, and that is intended. It is checked in to our perforce server, and part of this script is to automatically check it out for the user. Generally they will be working on a psd file, when they are ready to export the image to our engine, they run this script, select the targa file and let the script do all the work.

I would appreciate any suggestions to this problem.

Thank you,
Ted