Нужен человек знающий JScript или VBScript - Visavi.net https://visavi.net/ RSS - Visavi.net https://visavi.net/assets/img/images/logo_small.png RSS - Visavi.net https://visavi.net/ [email protected] (admin) [email protected] (admin) Sat, 20 Apr 2024 14:21:43 +0300 <pre class="prettyprint">#target photoshop if (app.documents.length &gt; 0) { var myDocument = app.activeDocument; var theName= myDocument.name.match(/(.*)\.&#91;^\.]+$/)&#91;1]; var thePath = myDocument.path; var theLayer = myDocument.activeLayer; // jpg options; var jpgopts = new JPEGSaveOptions(); jpgopts.embedProfile = true; jpgopts.formatOptions = FormatOptions.STANDARDBASELINE; jpgopts.matte = MatteType.NONE; jpgopts.quality = 8; // check if layer is smart object; if (theLayer.kind != &quot;LayerKind.SMARTOBJECT&quot;) {alert (&quot;selected layer is not a smart object&quot;)} else { // select files; if ($.os.search(/windows/i) != -1) {var theFiles = File.openDialog (&quot;please select files&quot;, &quot;*.psd;*.tif;*.jpg&quot;, true)} else {var theFiles = File.openDialog (&quot;please select files&quot;, getFiles, true)}; if (theFiles) { // work through the array; for (var m = 0; m &lt; theFiles.length; m++) { // replace smart object; theLayer = replaceContents (theFiles&#91;m], theLayer); var theNewName = theFiles&#91;m].name.match(/(.*)\.&#91;^\.]+$/)&#91;1]; //save jpg; myDocument.saveAs((new File(thePath+&quot;/&quot;+theName+&quot;_&quot;+theNewName+&quot;.jpg&quot;)),jpgopts,true); } } } }; ////// get psds, tifs and jpgs from files ////// function getFiles (theFile) { if (theFile.name.match(/\.(psd|tif)$/i) != null || theFile.constructor.name == &quot;Folder&quot;) { return true }; }; ////// replace contents ////// function replaceContents (newFile, theSO) { app.activeDocument.activeLayer = theSO; // ======================================================= var idplacedLayerReplaceContents = stringIDToTypeID( &quot;placedLayerReplaceContents&quot; ); var desc3 = new ActionDescriptor(); var idnull = charIDToTypeID( &quot;null&quot; ); desc3.putPath( idnull, new File( newFile ) ); var idPgNm = charIDToTypeID( &quot;PgNm&quot; ); desc3.putInteger( idPgNm, 1 ); executeAction( idplacedLayerReplaceContents, desc3, DialogModes.NO ); return app.activeDocument.activeLayer };</pre> Есть вот такой код, который делает то что мне нужно, проблема в том что на слой наложена карта смещения, код работает но на каждой вставляемой картинке всплывает диалог предлагающий обновить карту смещения. В мануале есть вот такой &quot;метод&quot;.<br> <blockquote class="blockquote">applyDisplace (horizontalScale, verticalScale, displacement, undefinedareas, displacementMapFiles)<br> Applies the Displace filter using the specified horizontal and vertical scale, mapping type, treatment of undistorted areas, and path to the distortion image map<br> </blockquote> Нужно добавить это в код, если я правильно понял...<br> Вот сам мануал <a href="http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/photoshop/pdfs/photoshop-cc-javascript-ref.pdf" target="_blank" rel="nofollow">http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/photoshop/pdfs/photoshop-cc-javascript-ref.pdf</a> на 56 странице про &quot;applyDisplace&quot;<br> Ну кто возьмется? https://visavi.net/topics/42028/678939 Нужен человек знающий JScript или VBScript наиль Tue, 24 Feb 2015 15:02:43 +0300 Сообщения https://visavi.net/topics/42028/678939 1. <strong>Koiot</strong>, если php плюс js ? А для приложения можно xml плюс js . https://visavi.net/topics/42028/678937 Нужен человек знающий JScript или VBScript Сергей Tue, 24 Feb 2015 13:28:33 +0300 Сообщения https://visavi.net/topics/42028/678937 Задача в следующем, для фотошопа имеется приблуда &quot;ExtendScript Toolkit&quot; позволяющая при помощи скриптов написанных JScript или VBScript обрабатывать изображения.<br> Здесь можно по подробней об этом прочесть <a href="http://geektimes.ru/post/112907/" target="_blank" rel="nofollow">http://geektimes.ru/post/112907/</a><br> Имеется макет в psd, и много картинок. Нужен скрипт который будет брать изображение, вставлять в макет и сохранять в png или jpg.<br> Буду рад если кто нибудь подскажет альтернативные методы позволяющие реализовать подобное. https://visavi.net/topics/42028/678762 Нужен человек знающий JScript или VBScript наиль Fri, 20 Feb 2015 14:01:16 +0300 Сообщения https://visavi.net/topics/42028/678762