How to begin with Photoshop scripting
After years of working with Photoshop I have started to device my own Photoshop scripts to automate my workflow.
My search for formal Photoshop script training produced no concrete results. In the past the Photoshop World Conference has offered Photoshop Scripting workshops.
Acquiring Photoshop scripting skills requires detective work and perseverance. The results are gratifying when a custom Photoshop script adds additional functionality and efficiency to your workflow.
Below is a list of resources I have compiled learn Photoshop scripting.
FORUMS AND BLOGS
TUTORIALS AND TRAINING
TEXT BOOKS AND GUIDES
SCRIPTING TOOLS
FORUMS AND BLOGS
Adobe Photoshop Scripting Community
https://forums.adobe.com/community/photoshop/photoshop_scripting
Independent Photoshop Scripting Community
http://ps-scripts.com/
PHOTOSHOP FOR GEEKS 2008
http://www.tranberry.com/photoshop/photoshop_scripting/PS4GeeksOrlando/IntroScripts/presen tations_materials/ps_geeks_slides.pdf
PHOTOSHOP FOR GEEKS 2007
http://www.tranberry.com/photoshop/photoshop_scripting/tips/photoshopforgeeks2.html
Jeff Tranberry’s blog
http://blogs.adobe.com/crawlspace/category/photoshop-scripting
http://tranberry.com/photoshop/photoshop_scripting/index.html
TUTORIALS AND TRAINING
Lynda.com
http://www.lynda.com/Photoshop-tutorials/Photoshops-scripting-backbone/289/22351-4.html
Trevor Morris Scripting Photoshop Part 1 and Part 2
http://morris-photographics.com/photoshop/tutorials/index.html
Code School (Javascript)
https://www.codeschool.com/paths/javascript
Tuts+ (Javascript)
http://courses.tutsplus.com/courses/javascript-fundamentals
w3schools
http://www.w3schools.com/js/default.asp
TEXT BOOKS AND GUIDES
Adobe Photoshop Scripting
http://www.adobe.com/devnet/photoshop/scripting.html
Power, Speed & Automation
http://www.amazon.com/Power-Speed-Automation-Adobe-Photoshop/dp/0240820835
Adobe Press: Learn How to Script Adobe Photoshop
http://www.adobepress.com/articles/article.asp?p=433750&seqNum=4
AdobeScripting: Your visual blueprint for scripting in Photoshop and Illustrator
http://www.amazon.com/Adobe-Scripting-blueprint-scripting-Illustrator/dp/0764524550/ref=la _B001KE7GZM_1_2?s=books&ie=UTF8&qid=1394514490&sr=1-2
Photoshop Speed Clinic
http://www.amazon.com/The-Photoshop-CS2-Speed-Clinic/dp/0321441656
SCRIPTING TOOLS
Photo Script Builder
http://madebyvadim.tumblr.com/post/71403984777/script-builder-free
This tool was available online for free until recently but has since become unavailable.
The idea behind this tool is excellent. Perhaps it will resurface as a commercial product in the future.
Script UI Builder (User Interface Dialogs)
https://sites.google.com/site/scriptuibuilder/
Adobe ESTK (Extended Script Tool Kit CC)
https://creative.adobe.com/products/estk
xtools
http://sourceforge.net/projects/ps-scripts/files/xtools/v2.1/
http://ps-scripts.sourceforge.net/xtools.html
https://github.com/search?q=photoshop&ref=cmdform
github is a great place to find jsx scripts
Similar Messages
-
how to make a selection of a layer delete content and paste another content with Photoshop scripting..?
There is a more specific Forum …
Photoshop Scripting -
Trying to update Camera Raw through CS6/Photoshop. Message received states I must close Photoshop. How can I update with Photoshop closed?
http://www.adobe.com/downloads/updates/
-
Hi guys, How is it going...
I really admire your work and how you guys are organized, but the thing is I was working in a company in Saudi Arabia for almost two years in .NET field. I found a better chance in Oracle field "HRMS exactly" I started in this company from one month now, I have alot of HRMS documents but I couldn't understand that much. I'm feeling lost.
So I'm asking you guys kindly to help begin from scratch I'm ready to do anyhing to start with HRMS (functional/Technical), even if I had to sell my soul to the devil :)
Thanks for anything you can provide.
Regards
Musa'ab Ghannaj
15/11/2011You may also see old threads for similar discussion.
https://forums.oracle.com/forums/search.jspa?threadID=&q=How+to+become+HRMS+Consultant&objID=f113&dateRange=all&userID=&numResults=15&rankBy=10001
https://forums.oracle.com/forums/search.jspa?threadID=&q=HRMS+AND+Career&objID=f113&dateRange=all&userID=&numResults=15&rankBy=10001
https://forums.oracle.com/forums/search.jspa?threadID=&q=New+to+HRMS&objID=f113&dateRange=all&userID=&numResults=15&rankBy=10001
https://forums.oracle.com/forums/search.jspa?threadID=&q=Learn+AND+HRMS&objID=f113&dateRange=all&userID=&numResults=15&rankBy=10001
Thanks,
Hussein -
Hi All,
Currently I am working as a D2k Developer. I would like to learn about Oracle apps.
Will you please guide me from where i have to start learning oracle apps.
And please advise me how i can become familiar with Oracle Apps by practice.
Regards and Thanks,
Ansaf.Ansaf,
What part of Oracle Apps you want to learn? Functional/Technical/Development?
Please search old thread for similar discussion.
http://forums.oracle.com/forums/search.jspa?threadID=&q=Oracle+Apps+DBA+Functional+Developer&objID=c3&dateRange=all
http://forums.oracle.com/forums/search.jspa?threadID=&q=Oracle+Apps+Developer+Career&objID=c3&dateRange=all
http://forums.oracle.com/forums/search.jspa?threadID=&q=Career&objID=f210&dateRange=all
Regards,
Hussein -
hi all,
i need to implement KM. EP is already in place, installed and configured. does KM means to access documents from some folder on my PC? If it is so...how do i do? do we have to create seperate folders in my PC or anywhere else? If not, how do i start off with. do i have to start with creating folders? or how?
i have dloaded DMS connector also. how do i start using it.
please help
chanHi,
KM is used to file all data of a company central. So everybody can use the documents/the knowledge of the others...
How can you integrate the documents?
--> The integration and access to the decentralized documents of the different file systems occur by the so called repository managers. In "Content Management" you can upload documents to the repository framework, it is in charge of the physical file.
Content Management --> Explorer --> Documents --> Folder --> New --> Upload
The TREX is in charge for classification of documents and search...
I hope I could give you a "little" insight into the SAP KM...
Helpful Links:
http://help.sap.com/saphelp_ep60sp2/helpdata/en/38/76bd3b6e74d708e10000000a11402f/frameset.htm
http://help.sap.com/saphelp_ep60sp2/helpdata/en/e9/83d5f20ea845b587be83de8554191e/frameset.htm -
Fuji RAW "RAF" How to read with photoshop?
Anyone tell me how to read a RAF file please?
I am using PS Elements 8 and a Fuji X20 with *.RAF files.
The PS e8 is fully updated.Charleton A Wyman wrote:
I want nothing for free they are not already providing in another way.
And we've been trying to inform you, even in light of your childish insults, that the world is not like that, no matter how much you stamp your feet and cry.
Try to understand that a number of very smart people here, who have thought about this a lot longer than you have and quite likely understand things better than you do, are advising you that you're off base.
You've been given the facts, including that the camera makers are purposefully creating unique file formats for each new camera they make, a practice which costs companies like Adobe significant engineering effort and time to decode. Adobe has even developed a fully featured, open raw file specification (the DNG standard) that the camera makers could use to solve this problem directly, but nooo, most of them won't use it. So you blame Adobe for not keeping your ancient software current, free of charge, and for some reason you seem to feel a software company shouldn't be allowed to profit from their work in improving their product.
You paid Fuji, the devious one in this situation, but you refuse to pay Adobe because they didn't reach into your computer and connect all the dots for you? You seem to think that someone - anyone - other than you needs to be your system integrator. As stated, the world is not like that.
Beyond that, you apparently don't have an interest in discussing how to get good results through the DNG conversion process, which despite your ranting folks here are still willing to discuss. But it seems you're too smart to suspect that your own inability to operate the raw converter effectively could be the problem there.
Your choices are clear. Pay to play, use the free product that invokes a bit of extra work, or go elsewhere. I'm sorry I did not list 3. Go away in my first response; my mistake.
-Noel -
How to read with a script in LDAP Active Directory
I there anyone have a perl/XML script for free download whitch used to search and read contact in LDAP directory.
Our company not chose the operation witch consit to point CM on Active Directory ,they prefers to write or find script perl/XML to do that.
Is it possible??
thanck you for your helpI am interested in the script that you created too. I have some LDAP books on the way and will try to learn scripting but I have no experience in it and any little push in the right direction would be much appreciated. We are trying to integrate AD with CCM which we did with CCM 4.0.2 but now the Directories button does not work, which we new it wasn't going to, but they want me to create several menu listings say
1.
2.Standard Cisco Missed, Placed and Received Calls
3.
4. Corporate that will automatically search the entire AD.
5. This will search only in OU X
6. This will search in only OU y
7.
8. This will search only in UN to the Nth
If this is possible I would be in your debt if I could just get a sample to give me a push in the right direction.
Thanks
My e-mail address is [email protected] -
How to begin with BI...
hello all..
can i hav some idea and description abt Bi...im absolutely new to BI..so any help appreciated...
regards...
vishalhi vishal,
bi - business intelligence is a set of concepts and methodologies to improve decision making in business through use of facts or fact-based system - Howard Dresner
take a look sap bi overview
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/b3b9b990-0201-0010-6d8f-e55f09e63bf7
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/b7e8a190-0201-0010-42a5-bf5f7aa1c905
then
http://service.sap.com/bi
http://help.sap.com/bp_biv135/index.htm
http://help.sap.com/saphelp_nw04s/helpdata/en/b2/e50138fede083de10000009b38f8cf/frameset.htm
http://www.bwexpertonline.com
books : mastering business information warehouse Kevin McDonald, sap business information warehouse Naeem Hashmi -
How can I find the Scripts directory from a script?
Hello all! After playing with Photoshop scripting, I'm now playing with AE too, and in my first try I've stuck in finding the scripts path from the script itself.
In Photoshop, there was this piece of code that somebody in the Photoshop Scripting forum kindly shared:
var scriptsPath = new Folder (app.path + "/" + localize ("$$$/ScriptingSupport/InstalledScripts=Presets/Scripts"));
But this line doesn't work in After Effects because app.path variable doesn't exist (very funny, I thought Photoshop and After Effects shared the same basic app variables) and the path given to the "localize" function is wrong in AE (I think "$$$" means nothing to it).
Can somebody give me a clue about how to solve this? Thanks a lot in advance :-)This script shows a couple of examples you can try. The first part shows a way to get the folder the running script is in. The second gets the main AE app folder although I don't know if appFolder works on Windows (you'd still need to add /Scripts on Mac or /SupportFiles/Scripts on Win).
var thisScript = new File($.fileName);
var containingFolder = new Folder(thisScript.parent.absoluteURI);
alert("This script is in " + containingFolder.absoluteURI);
var appFolder = new Folder(Folder.appPackage.parent.absoluteURI);
alert("The app folder is at " + Folder.decode(appFolder.absoluteURI)); -
As increase DPI, image size is also increase in photoshop scripting ?
as increase DPI, image size is also increase in photoshop scripting can please tell me what will the reason for that?
Hi JJMACK,
I am using adobe Flex with Photoshop scripting . I am sending Flex file with parameter to generate .psd.Right now i am able to generate 72 DPI with proper image size while I am generating .psd with 250 DPI with Improper Size.
E.g
This is my flex parameters
MgrPSAction.instance.FinishLayoutToPhotoshop(curFl , savedType ,TemplateConstant.TM_LEFT,getPSDImageName(objItem,TemplateConstant.TM_LEFT_RIGHT), objItem.LayoutTMLWidth,objItem.LayoutTMLHeight ,pageDPI,returnPhotoshopHandler,
true,setWidth , setHeight,formatQty); ----- Page DPI - > like 72 or 250 paasing from here.
below is Scirpt ot resize
function openFileAndResize(xp,yp,wi,hi,imagepath)
var fileRef = new File(imagepath);
var curRefDoc = app.open(fileRef);
var curw = curRefDoc.width;
var curh = curRefDoc.height;
var resW;
var resH;
var scw = imgObj.wi/curw;
var sch = imgObj.hi/curh;
var scale ;
if(scw > sch)
scale = scw;
else
scale = sch;
resW = curw * scale;
resH = curh * scale;
if(imgObj.isAdjustImage == "true")
resW = resW * parseFloat (imgObj.scaleOrg);
resH = resH * parseFloat (imgObj.scaleOrg);
// Resize Image=======================================================
var idImgS = charIDToTypeID( "ImgS" );
var desc226 = new ActionDescriptor();
var idWdth = charIDToTypeID( "Wdth" );
var idPxl = charIDToTypeID( "#Pxl" );
desc226.putUnitDouble( idWdth, idPxl, resW);
var idHght = charIDToTypeID( "Hght" );
var idPxl = charIDToTypeID( "#Pxl" );
desc226.putUnitDouble( idHght, idPxl, resH );
var idIntr = charIDToTypeID( "Intr" );
var idIntp = charIDToTypeID( "Intp" );
var idBcbc = charIDToTypeID( "Bcbc" );
desc226.putEnumerated( idIntr, idIntp, idBcbc );
executeAction( idImgS, desc226, DialogModes.NO );
// Select Image=======================================================
var idsetd = charIDToTypeID( "setd" );
var desc263 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref138 = new ActionReference();
var idChnl = charIDToTypeID( "Chnl" );
var idfsel = charIDToTypeID( "fsel" );
ref138.putProperty( idChnl, idfsel );
desc263.putReference( idnull, ref138 );
var idT = charIDToTypeID( "T " );
var idOrdn = charIDToTypeID( "Ordn" );
var idAl = charIDToTypeID( "Al " );
desc263.putEnumerated( idT, idOrdn, idAl );
executeAction( idsetd, desc263, DialogModes.NO );
//Copy Image=======================================================
var idcopy = charIDToTypeID( "copy" );
executeAction( idcopy, undefined, DialogModes.NO );
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
//Create Temp Layer for image adjustment =======================================================
//createApplication(wi,hi,dpi,"imagelayerdoc");
createApplication(wi,hi,dpi,layerAppName);
//var curDoc = getCurDoc('imagelayerdoc');
//get Active Temp Layer for image adjustment =======================================================
var curDoc = getCurDoc(layerAppName);
app.activeDocument = curDoc;
// Past Copy image in Temp Layer for image adjustment =======================================================
var idpast = charIDToTypeID( "past" );
var desc250 = new ActionDescriptor();
var idAntA = charIDToTypeID( "AntA" );
var idAnnt = charIDToTypeID( "Annt" );
var idAnno = charIDToTypeID( "Anno" );
desc250.putEnumerated( idAntA, idAnnt, idAnno );
executeAction( idpast, desc250, DialogModes.NO );
// HERE YOU NEED TO SET XY POSTION OF IMAGE
positionLayer(app.activeDocument.activeLayer,imgObj.moveX,imgObj.moveY);
cropImage();
Please reply if have answer...
Thanks -
I use Adobe Photoshop CS4_Bridge _Photo Downloader to import images from CF Cards into my 11" Mac Book Air. I have an issue with the Text files
that seem to accompany each and every image that I do not need. How do I stop Apple Script (which I assume is the culprit in this case) from interferring with this process.Your iWeb Site is stored not on your iDisk, but on a file named Domain.sites in your ~/Home/Library/Application Support/iWeb/ Folder.
If , for whatever reason, you wipe your HD and/or lose this file (Get a new computer, Re-Install your OS, Stolen Laptop, Crashed HD, Etc.) without backing-up your Domain.sites file then you will have to re-build your iWeb sites from scratch again.
Of course you can edit your Published HTML files in a different program such as Dreamweaver or even Text Edit. You just can't edit Published HTML files in iWeb. Not at this time at least.
Use iWebBackup to backup your Domain file to a Blank CD or DVD. Backing up your Domain file to another folder on your computer is not fully backing it up. If your computer gets stolen you still lost the file but if you have your Domain file burned onto a CD you have a backup!
Download iWebBackup Here
You can use iWebExtender to automatically consolidate your files into one folder and delete multiple images.
http://iWebFAQ.com -
Hello Everybody, and thank you very much if you can answer to my little problem
So here is the beginning of my script. At the end it will be a script to batch convert Psd files to jpeg in different resolutions, in different folders.
I wanted to understand subtlety some parts of applescript, but I have to say that I failed for this case.
So the part I am looking for is to compare files between two folders, not exactly like syncing.
In the first Folder, psds files.
In the second, Jpgs, wich have been made from the psds, with a 2nd part of the script, batch to jpeg.
I want to compare these files to tell the 2nd script not to batch them to jpeg if they have not been modified.
So the steps I would like to write :
tell applescript to :
1 -
get every files of folder "psd" without invisibles
get only the names of these files without extension
get the modification date of these files
2-
get every files of folder "jpg" without invisibles
get only the names of these files without extension
get the modification date of these files
3- compare the names of the files in psd's and jpg's folders (it's why I didn't want the extension)
if some or all Psds already exist in jpg folder, then
compare the modification dates of these same files
and if these files in psd folder are more recent than in jpeg folder, then
get only these modified files in psd folder, and, also the new ones (not existing in jpg folder).
and --
4 - launch my batchconverttojpg for this result
(at this moment I only want to find steps 1, 2 and 3)
--- It is important for me to do that, because the files in psd's folder will always change, and I can have really big files (like 500 or 800 mo each), and it will be really faster to batch only modified files…
--- Here is the beginning of the script I am writing, but … bug bug bug, I don't find the good way to write that…
set folder1 to "Macintosh HD:Users:Me:Desktop:test batch convert-script:psds" as string
set folder2 to "Macintosh HD:Users:Me:Desktop:test batch convert-script:jpegs:Jpegs" as string
set AppleScript's text item delimiters to ""
tell application "System Events"
set imgsources to every file of folder folder1 whose name does not start with "." and (file type is "psd" or file type is "JPG" or name extension is "psd" or name extension is "jpg")
set imgcibles to every file of folder folder2 whose name does not start with "." and (file type is "psd" or file type is "JPG" or name extension is "psd" or name extension is "jpg")
end tell
--tell application "Finder"
repeat with i from 1 to the count of imgsources without invisibles
set img to (item i of imgsources as alias)
set infosource to info for img
set nameimg1 to name of infosource -- recupere le nom de limage + extension
--set extimg2 to items -1 thru -4 of nameimg2 as text -- recupere l'extension
set nimg1 to items 1 thru -5 of nameimg1 as text -- recupere le nom
set moddateimg1 to modification date of infosource -- recupere la date de modif
repeat with i from 1 to the count of imgcibles without invisibles
set img2 to (item i of imgcibles as list) -- recupere tous les elements du dossier
set infocible to info for img2 -- recupere les infos
set nameimg2 to name of infocible -- recupere le nom de limage de destination
set extimg2 to items -1 thru -4 of nameimg2 as text -- recupere l'extension
set nimg2 to items 1 thru -5 of nameimg2 as text -- recupere le nom
set moddateimg2 to modification date of infocible -- recupere la date de modif
tell application "Finder"
if nimg1 = nimg2 as text then
--set nimg1 to nimg1 as string
--set nimg2 to nimg2 as string
--set name of img2 to folder2 & ":" & nimg2 & "-" & "2" & extimg2 as text
set name of img2 to nimg2 & "-" & "2" & extimg2
-- I am just trying to rename the file at this step.
-- After this, I will compare the dates, and then, batch convert.
end if
end tell
end repeat
end repeat
So if one of you have the good solution It will be a miracle for me
I have to say that if I wrote this script in a simple way like that, it's to be able to understand what I do, or to understand the script after 6 month, without thinking about it…
Thank you very much for your answers
FredOk so there are a lot of things I didn't know about some details… And I see that I will never have succeed to write something like that…
I don't really understand why to "set psdNames to --> {}" this last detail is unknown for me…
And if I understand, the thing I missed is to do a listindex of the items ? it's why I didn't succeed to compare the files ?
Then I though that it could be interesting for you or differents users to see the result. I think it works perfectly now.
Of course, I am not professional in applescript editing, so if you have some comments or modifications, do not hesitate to post them here
Thanks again to Red_Menace !
Fred
Here it is :
(sorry I didnt translate all the notes to English. Just have to know that the script proceed in the folder where it is. If it's not save in the good folder before execute, or save as application in the good folder, then it will proceed in the default folder "applications"... so careful
display dialog " Attention, Le script va créer un dossier psd, et déplacer les fichiers psds ici dans ce nouveau dossier" & return & " Et va ensuite procéder à la création de" & return & " Jpegs dans différents dossiers" buttons {"Ok", "Annuler", "+ d'explications"} default button "OK"
if button returned of the result is "+ d'explications" then
explications()
return
end if
--Application utilisée : adobe photoshop CS3
--Changer la version si besoin dans les lignes ci dessous
--Changer le nom des dossiers ici, sans avoir à changer le reste du script
set nomdossierpsds to "psds"
set psdsFolder to nomdossierpsds
set tempFolderName to "Exports"
set tempfoldername1 to "Jpegs_HD"
set tempfoldername2 to "Jpegs_SD"
--Pour changer la taille des Jpegs SD --
set choixtaille to "1200"
tell application "Finder"
set racine to get folder of (path to me) as Unicode text
set nomprojet to name of folder racine
--if folder psd exists but with different case
if exists folder "psd" in folder racine then
set name of folder "psd" in folder racine to psdsFolder
end if
if exists folder "Psd" in folder racine then
set name of folder "psd" in folder racine to psdsFolder
end if
if exists folder "Psds" in folder racine then
set name of folder "Psds" in folder racine to psdsFolder
end if
--2 -- check si le dossier psd existe, sinon le crée.
if not (exists folder psdsFolder in folder racine) then
make new folder in folder racine with properties {name:psdsFolder}
set psdsFolder to folder psdsFolder in folder racine as alias
open folder psdsFolder
--display dialog "Avant de Continuer, Placer les images dans le dossier Psds" buttons {"Annuler"} default button 1
else
set psdsFolder to folder (racine & "psds") as alias
end if
--if Psd folder didnt exists, then move psd files in
set psds to (files of folder racine whose name extension is "psd")
move psds to folder psdsFolder
--Dossier Jpegs Racine -- outputFolder -- check si present sinon creation
if not (exists folder ((racine as string) & tempFolderName)) then
set outputFolder to make new folder at racine with properties {name:tempFolderName}
else
set outputFolder to folder ((racine as string) & tempFolderName)
end if
--Dossier Jpegs HD -- outputFolder1 pour photoshop -- check si present sinon creation
if not (exists folder (((racine as string) & tempFolderName as string) & ":" & tempfoldername1)) then
set outputFolder1 to make new folder at outputFolder with properties {name:tempfoldername1}
else
set outputFolder1 to folder ((racine as string) & tempFolderName & ":" & tempfoldername1)
end if
set outputFolder1 to outputFolder1 as alias
--Dossier Jpegs SD -- outputFolder2 pour photoshop -- check si present sinon creation
if not (exists folder (((racine as string) & tempFolderName as string) & ":" & tempfoldername2)) then
set outputFolder2 to make new folder at outputFolder with properties {name:tempfoldername2}
else
set outputFolder2 to folder ((racine as string) & tempFolderName & ":" & tempfoldername2)
end if
set outputFolder2 to outputFolder2 as alias
end tell
--recupere le chemin du dossier des psds à procéder
tell application "Finder"
set psdsFolder to folder (racine & nomdossierpsds) as alias
end tell
--1
tell application "Finder" -- get file items from the folders (coerce list items to aliases for use later)
set psdFiles to (files of folder psdsFolder whose name extension is "psd") as alias list
set jpgFiles to (files of folder outputFolder1 whose name extension is "jpg" or name extension is "psd") as alias list
end tell
--2
set psdNames to {} -- get the psd file names (these are in the same order as the file items)
repeat with anItem in psdFiles
set the end of psdNames to (justTheName from anItem)
end repeat
set jpgNames to {} -- get the jpg file names (these are in the same order as the file items)
repeat with anItem in jpgFiles
set the end of jpgNames to (justTheName from anItem)
end repeat
--3
set filesList to {} -- figure out the files to process
repeat with X from 1 to (count psdNames)
set theName to contents of (item X of psdNames) -- get a name from the psd list
if theName is in jpgNames then -- found a jpg match, so check the date
set match to (listIndex of theName from jpgNames) -- get the index of the matching name
tell application "Finder" -- look up the file items for the matching names and get the dates
set psdDate to modification date of (item X of psdFiles)
set jpgDate to modification date of (item match of jpgFiles)
end tell
if psdDate > jpgDate then set the end of filesList to (item X of psdFiles) -- newer file, so add
else -- no match, so add
set the end of filesList to (item X of psdFiles)
end if
end repeat
filesList --> this list contains items (aliases) that are not in jpgsFolder or have a newer modification date
tell application "Adobe Photoshop CS3"
activate
set display dialogs to never
close every document saving no
end tell
repeat with aFile in filesList
set fileIndex to 0
tell application "Finder"
-- The step below is important because the 'aFile' reference as returned by
-- Finder associates the file with Finder and not Photoshop. By converting
-- the reference below 'as alias', the reference used by 'open' will be
-- correctly handled by Photoshop rather than Finder.
set theFile to aFile as alias
set theFileName to name of theFile
end tell
tell application "Adobe Photoshop CS3"
activate
open theFile
set docRef to the current document
set docHeight to height of docRef
set docWidth to width of docRef
------------------------------------------------------------------- 1st Export to jpeg
--Convert the document to a document mode that supports saving as jpeg
flatten docRef
tell docRef to convert to profile "sRGB IEC61966-2.1" intent perceptual with dithering and blackpoint compensation
if (bits per channel of docRef is sixteen) then
set bits per channel of docRef to eight
end if
--The first copy is simply saved with additional document info added
set infoRef to get info of docRef
set copyright notice of infoRef to "Copyright Frédéric Perrin"
set docName to name of docRef
set docBaseName to getBaseName(docName) of me
--set fileIndex to fileIndex + 1
set newFileName to (outputFolder1 as string) & docBaseName & ".jpg"
save docRef in file newFileName as JPEG appending lowercase extension with options {class:JPEG save options, quality:12, format options:optimized}
------------------------------------------------------------------- 2nd export to jpeg
-- The second copy is saved resized to width of 100 pixels proportionally
-- There is no scale constraint in the resize image command.
-- Use the height/width ratio to simulate the option.
set ruler units of settings to pixel units
set type units of settings to pixel units
resize image current document width choixtaille height (choixtaille * docHeight / docWidth)
-- repete la mise en memoire des variables, sinon des bugs
set docRef to the current document
set docName to name of docRef
set docBaseName to getBaseName(docName) of me
--set fileIndex to fileIndex + 1
set newFileName2 to (outputFolder2 as string) & docBaseName & "-" & choixtaille & ".jpg"
save docRef in file newFileName2 as JPEG appending lowercase extension --with options {class:JPEG save options, quality:12, format options:optimized}
-- The original document is closed without saving so it remains as it was
-- when opened for batch processing
close current document without saving
end tell
end repeat
-- Routines
-- Returns the document name without extension (if present)
on getBaseName(fName)
set baseName to fName
repeat with idx from 1 to (length of fName)
if (item idx of fName = ".") then
set baseName to (items 1 thru (idx - 1) of fName) as string
exit repeat
end if
end repeat
return baseName
end getBaseName
on justTheName from someFile
get the name from a file path
parameters - someFile [various]: a complete file path (POSIX or Finder)
returns [text] - the base file name
set someFile to someFile as text
tell application "System Events" to tell disk item someFile
set {theName, theExtension} to {name, name extension}
end tell
if theExtension is in {missing value, ""} then
set theExtension to ""
else
set theExtension to "." & theExtension
end if
return text 1 thru -((count theExtension) + 1) of theName -- just the name part
end justTheName
to listIndex of anItem from someList
get the (first) index of anItem in someList
parameters - anItem [various]: the item to look for
someList [list]: the list to look in
returns [integer]: the index (0 if not found)
set theIndex to 0
repeat with X from 1 to (count someList)
if (contents of (item X of someList)) is anItem then
set theIndex to X
exit repeat
end if
end repeat
return theIndex
end listIndex
on explications()
tell application "TextEdit"
activate
make new document
set text of front document to ¬
"--- Attention --- Le Script se lance pour gérer le dossier dans lequel il se trouve." & return & return & ¬
"Pour ne plus voir ce message, ouvrir le script/application et l'éditer avec un éditeur comme Editeur applescript : Effacer alors le premier paragraphe --> End Message" & return & return & return & ¬
"Il vérifie l'existence d'un dossier Psd, s'il existe, mais pas dans la bonne casse, renomme le dossier --" & return & "Donc -- attention -- si d'autres scripts sont chainés à ce dossier, il faudra mettre à jour la casse ou orthographe, sinon changer les variables en début de script afin que tous les scripts marchent avec le meme nom de ce dossier psd" & return & return & ¬
"Une fois cela géré, le dossier -psds- est créé, sil n'est pas deja la. Les fichiers psds pouvant être présents à la racine du dossier, où se trouve le script, seront déplacés dans le dossier psd" & return & ¬
"Ensuite, création d'un dossier jpeg contenant deux autres dossiers : jpgs HD et Sd, le 1er contiendra les jpegs à la resolution source du psd, le dossier Sd à la résolution de 1200px, soit acceptable pour le web ou le partage temporaire" & return & return & ¬
"Pour finir, le script peut être relancé à l'infini, les dossiers se synchronisent en fonction du dossier Psd et JpegsHD. Si de nouveaux fichiers se trouvent dans le dossier Psd, ou bien sils ont été modifiés, alors ils seront re-batchés en jpegs dans les dossiers correspondants." & return & ¬
"Donc -- Attention -- , ne jamais faire de retouches sur les fichiers Jpegs, seulement sur les psds, et -- attention-- aussi, les fichiers jpegs correspondants aux psds retouchés seront écrasés" & return & ¬
"Pour conserver des versions des fichiers, à la main, renommer séquentiellement les psds à l'enregistrement dans photoshop, ainsi les jpegs seront séquentiels aussi" & return & return & return & ¬
"La préférence, de choisir à la main la séquence des fichiers psds semble être plus pratique à l'usage, et de garder un minimum la main sur les images, afin de s'y retrouver" & return & return & return
end tell
end explications
------------------------------------------------------------------- -
In Safari How to open an Image with PhotoShop
Hi everyone.
I need your help, advise...
I have a html page with this tag:
Image
CFD is a Share
If I use Explorer when I click the link (using the File Helpers) the image is open with PhotoShop. I need the same functionality in Safari, is there a way to do that...?
Or how can I accomplish this task?
Thank you for your help.
jhpe.Thanks for your response. I've just started with Javascript scripting in Photoshop so I'm still just a bit confused though .
The code you've provided will return the location on my computer of where the script resides, am I right? And since the script and the images are in the same folder, this should mean a relative address is obtainable?
How could I use this in connection with:
var fileRef = new File("image01.jpg");
var docRef = app.open(fileRef);
where image01,jpg is the image I'd like to open in the same folder as the script?
Thanks again for your help. -
How to write a shell script to execute a procedure with out parameter
Hi,
How to write a shell script to execute a procedure with out parameter.
here is my procedure
PROCEDURE sample(invar1 VARCHAR2,
invar2 VARCHAR2,
invar3 VARCHAR2,
invar4 VARCHAR2,
ecode out number);
Any example really helpfull
Thanks in advanceOr if we're passing values in, maybe something like:
Test procedure:
CREATE OR REPLACE PROCEDURE p (myin IN VARCHAR2, myout OUT VARCHAR2)
AS
BEGIN
myout :=
CASE myin
WHEN 'A' THEN 'APPLE'
WHEN 'B' THEN 'BANANA'
ELSE 'STARFRUIT'
END;
END;Shell script:
#!/bin/bash
my_shell_variable=$1
unset ORACLE_PATH
sqlplus -s un/pw@db <<-EOF
set feedback off pause off
set pagesize 0
set autoprint off
VAR out varchar2(30)
VAR myin varchar2(30)
exec :myin := '${my_shell_variable}'
BEGIN
p(:myin, :out);
END;
print out
exit
EOFTest:
/Users/williamr: xx A
APPLE
/Users/williamr: xx B
BANANA
/Users/williamr: xx
STARFRUITObviously in a real script you would not hardcode the password or let it show in a "ps" listing.
Message was edited by:
William Robertson
Maybe you are looking for
-
EmailSubmitButton's "Select Email Client" dialog different in Reader XI?
With Adobe Reader X we used to get a dialog looking as below: When selecting Internet Email one was offered to save the file as XML. With Reader XI it looks like (in Swedish): In this dialog there seems to be no way of saving the data as XML. Instead
-
How can we call java control source methods within jsp
Hi guys! How can we access java control source methods that are defined in java control projects within jsp.I am getting error when I tried to call java control source's methods in scriptlet of JSP page.Any help/suggestion is appreciated.
-
HP2540 A-i-O Scans but won't print. Windows 8.1
My new PC, running Windows 8.1, forced me to buy a new printer, as it doesn't support drivers for my old 6122! I have installed the printer for wireless operation, through my home hub, and Diagnostic Results says "No problems found." All results ar
-
HT1212 how can i reset my phone that is locked
hey! urgent! i need to reset my phone but its locked with a passcode help!
-
Intermittent 'Unknown Database Connector' Error with Crystal XI in VFP9 app
We have a VFP9 application which uses Crystal XI as its reporting tool. We use Installshield Express to install the Crystal components by including the merge modules in the setup. We extract data in the VFP app then write it to the local temporary fi