Hello,
even if i work a lot with PS i am a beginner with scripting. I hope you can help me here with my topic:
I would like to open 1 random image of one Folder in PS.
I would like to open 1 random image of another Folder in PS.
I would like to open 1 random image of another Folder in PS.
Then i would like to collect these 3 random images as layers in one PS Document.
Do you have an Idea/Code/Scrip how I can achieve this?
Thanks a lot for your help!
Open Random Images of different Folders as Layers
Re: Open Random Images of different Folders as Layers
What would be images format, orientation, dimension and their resolution, the same for all?
Re: Open Random Images of different Folders as Layers
Hi Kukurykus,
thank you for your reply!
Yes, all images will have same file type/format, orientation, dimension and resolution.
thank you for your reply!
Yes, all images will have same file type/format, orientation, dimension and resolution.
Re: Open Random Images of different Folders as Layers
Code: Select all
preferences.rulerUnits = Units.PIXELS, sTT = stringIDToTypeID;
(ref = new ActionReference()).putProperty(sTT('property'), gP = sTT('generalPreferences'))
ref.putClass(sTT('application')); (dsc1 = new ActionDescriptor()).putReference(sTT('null'), ref);
arr = ['placeRasterSmartObject', 'resizePastePlace']; dsc2 = new ActionDescriptor(); while(arr.length)
dsc2.putBoolean(sTT(arr.shift()), false), dsc1.putObject(sTT('to'), gP, dsc2), executeAction(sTT('set'), dsc1)
dcmnt = documents.add(1, 1, 300, '', null, DocumentFill.TRANSPARENT, null, null, 'none')
runMenuItem(sTT('screenModeFullScreen')); for(i = 0; i < 3;) (dsc = new ActionDescriptor())
.putPath(sTT('null'), (fls = File('~/desktop/Folder/' + ++i).getFiles())[~~(Math.random() * fls.length)]),
executeAction(sTT('placeEvent'), dsc); dcmnt.revealAll(), runMenuItem(sTT('fitOnScreen')), togglePalettes()