Copy link to clipboard
Copied
Hy all,
this is the situation:
I have got a psd file. I want this file to be saved automatically as Documentname1.png while it originally is Documentname.psd.
The script doesn't have to ask what number i want to add, i can find that in the script and change that myself.
It also have to save the file in another folder than where the Documentname.psd is saved.
Could anyone creat a script for this action? I don't have any experience at scripting at all.
Tnx!
this folder is always the same, say that it is: C:\Documents and Settings\png
I think you meant your 'My Documents' folder, so here is a new version:
if (app.documents.length > 0) {
var myDoc = app.activeDocument;
var myDocName = myDoc.name;
if (myDocName.lastIndexOf("psd") > 0) {
var myNewFolder = new Folder(Folder.myDocuments.fsName + "/png");
if (!myNewFolder.exists) myNewFolder.create();
var myNewName = myDocName.replace(/.psd$/, "1.png");
var myNewFile = n
Copy link to clipboard
Copied
Heyy, im working with your scripts for a little while now, and i have to say that it works PERFECT!
one little question: Is there a way to get it to work automatically with everyone??
Let me explain it: Now i set the script to save it on the desktop. That's ok. But when i give the action to someone else, they first have to record the scripts and the "open" actions again. This is because when i record the action, it records from the location: C:\Documents and Settings\Pluim\Desktop (Pluim is the name i gave the pc). But ofcourse this name is different with everybody. So how can i record an action in PS in such a way, that it will also directly work on somebody else his pc??
Tnx!
Copy link to clipboard
Copied
So how can i record an action in PS in such a way, that it will also directly work on somebody else his pc??
I would use X-Tools to convert the action into a script and then would change the recorded path -- C:\Documents and Settings\Pluim\Desktop -- to Folder ("~/Desktop")
Copy link to clipboard
Copied
but do i have to download whole x-tools?? Cause there is such a lot i don't use in that program. Is there mayby another program which can do it (windows)?? And is it then also possible to convert it back to a photoshop action (atn file)??
EDIT: never mind, found the right x-tools. it works good, but the weird thing is, that it should already work correct. But, can't test it myself, so i'll ask someone else.
Tnx again!
Copy link to clipboard
Copied
I can't answer your questions right how because I have X-tools installed on my home computer, but I am at work.
I am not sure, but I think that you can convert a script back into action.
Copy link to clipboard
Copied
I am not sure, but I think that you can convert a script back into action.
With xtools you can convert actions/.atn files to XML or JavaScript.
You can modify the translated XML (carefully) and convert it back to a .atn file.
You cannot modify the translated JavaScript back to a .atn file.
-X
Copy link to clipboard
Copied
Thank you for quick response, X. Now it's more clear.
One more question:
I created a new set and a new action in it, which opens a file from the desktop. The action looks like so:
Open
C:\Documents and Settings\Kasyan\Desktop\test.tif
Then I run ActionFileToXML and opened the xml-file, where path key has value "~/Desktop/test.tif" -- the path is independent of current user name.
Finally I run ActionFileFromXML and load the new set. The path is bound to the current user name again: C:\Documents and Settings\Kasyan\Desktop\test.tif
Is it possible to modify the path in XML-file in a such way that it become 'user independent'? Or, is using ActiontoJavascript the only option in this case?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
It's working like a ferrari
Thanks a lot for all the help, you guys really help newbie scripters out of their problems
Greetz
Copy link to clipboard
Copied
I also want to learn it, so what is a good tutorial and where can you find all the names etc??
Check out this site:
http://www.tranberry.com/photoshop/photoshop_scripting/index.html
Find PhotoshopScripting.pdf – a good tutorial for total begginer.
Read also 'Photoshop CS3 Scripting Guide.pdf' – it's in your 'Adobe Photoshop CS3\Scripting Guide' folder.
http://www.pstut.com/tutorial-photoshop-scripts-an-introduction.html
http://www.good-tutorials.com/tutorials/photoshop/scripting?page=1
Copy link to clipboard
Copied
As an option, you can record your action with Action Manager and then make a few changes – much easier for a newbie-scripter:
if (app.documents.length > 0) {Copy link to clipboard
Copied
See this post:
http://forums.adobe.com/message/1912911#1912911
Copy link to clipboard
Copied
Hi there,
ive got a problem concerning the script:
Somebody wants to use it, but faces a problem with the 'save as psd'-script. He got the following message:
"
Error 19: Bad argument add.
Line: 12
-> var myGroup = myDialog.add('group');
"
At my sight (im using windows xp) the script is working perfectly. But at his sight (he uses vista) the script won't work and causes this error.
Is it some kind of incompatibility with vista?? He's the first one complaining about this..
Thanx in advance!
JoOosty