r-bin
People's Champ
r-bin
People's Champ
Activity
Oct 31, 2017
04:45 PM
2 Upvotes
test this ) function has_timeline() { try { var r = new ActionReference(); r.putProperty(charIDToTypeID('Prpr'), stringIDToTypeID('documentTimelineSettings')); r.putClass(stringIDToTypeID('timeline')); try { executeActionGet(r); } catch (e) { return false; } return true; } catch (e) { alert(e); } }
... View more
Oct 31, 2017
05:23 AM
I do not use animation at all, but maybe the following functions will be useful, i hope function next_key_frame() { var d1 = new ActionDescriptor(); var d2 = new ActionDescriptor(); d2.putEnumerated( stringIDToTypeID( "trackID" ), stringIDToTypeID( "stdTrackID" ), stringIDToTypeID( "sheetPositionTrack" ) ); d1.putObject( stringIDToTypeID( "trackID" ), stringIDToTypeID( "animationTrack" ), d2 ); executeAction( stringIDToTypeID( "nextKeyframe" ), d1, DialogModes.NO ); } function prev_key_frame() { var d1 = new ActionDescriptor(); var d2 = new ActionDescriptor(); d2.putEnumerated( stringIDToTypeID( "trackID" ), stringIDToTypeID( "stdTrackID" ), stringIDToTypeID( "sheetPositionTrack" ) ); d1.putObject( stringIDToTypeID( "trackID" ), stringIDToTypeID( "animationTrack" ), d2 ); executeAction( stringIDToTypeID( "previousKeyframe" ), d1, DialogModes.NO ); }
... View more
Oct 29, 2017
11:46 AM
2 Upvotes
You can use get_run_counter() set_run_counter() or _get_run_counter() _set_run_counter() functions to determine the number of script starts since the start of the photoshop. /////////////// var options_name = "My Options"; alert (get_run_counter()) inc_run_counter(); alert (_get_run_counter()) _inc_run_counter(); //////////////////////////////////////////////////////////////////////////////////////////// function get_run_counter() { var d = null; try { d = app.getCustomOptions(options_name); } catch(e) { d = null; } if (!d) return 0; return d.getInteger(0); } //////////////////////////////////////////////////////////////////////////////////////////// function inc_run_counter() { var cnt = get_run_counter(); var d = new ActionDescriptor(); d.putInteger( 0, cnt+1); app.putCustomOptions(options_name, d, true); } //////////////////////////////////////////////////////////////////////////////////////////// function _get_run_counter() { var cnt = $.getenv(options_name); if (cnt == null || cnt == undefined) return 0; return Number(cnt); } //////////////////////////////////////////////////////////////////////////////////////////// function _inc_run_counter() { var cnt = _get_run_counter(); ++cnt; $.setenv(options_name, cnt.toFixed(0)); }
... View more
Oct 29, 2017
11:24 AM
You can use this method var layer0 = app.activeDocument.activeLayer; app.activeDocument.artLayers.add(); app.activeDocument.activeLayer.move(layer0, ElementPlacement.PLACEBEFORE);
... View more
Oct 29, 2017
09:47 AM
// mode_str = "Nrml"; "Lghn", "Drkn", "Nrml", "Clr ", "Lmns", etc... //////////////////////////////////////////////////////////////////////////////////////////// function add_layer(name, op, mode_str, grp) { try { var desc3 = new ActionDescriptor(); var ref1 = new ActionReference(); ref1.putClass( charIDToTypeID( "Lyr " ) ); desc3.putReference( charIDToTypeID( "null" ), ref1 ); var desc4 = new ActionDescriptor(); if (name != undefined) desc4.putString( charIDToTypeID( "Nm " ), name); if (op != undefined) desc4.putUnitDouble( charIDToTypeID( "Opct" ), charIDToTypeID( "#Prc" ), op ); if (grp != undefined) desc4.putBoolean( charIDToTypeID( "Grup" ), grp ); if (mode_str != undefined) { var mode = (mode_str.length==4) ? charIDToTypeID(mode_str) : stringIDToTypeID(mode_str); desc4.putEnumerated( charIDToTypeID( "Md " ), charIDToTypeID( "BlnM" ), mode ); } desc3.putObject( charIDToTypeID( "Usng" ), charIDToTypeID( "Lyr " ), desc4 ); executeAction( charIDToTypeID( "Mk " ), desc3, DialogModes.NO ); ref1 = null; desc3 = null; desc4 = null; } catch(e) { alert(e); throw(e); } }
... View more
Oct 27, 2017
01:10 AM
There are similar problems with the Treeview. Everything works great on CS6. It broke down with the release of 2015.5 or near so. But I hoped that in CC2018 it would be repaired. It's like no one seems to notice it. Can someone bring this information directly to the developers?
... View more
Oct 26, 2017
12:30 PM
instead of this var tempFile = File1; tempFile = tempFile.File1; use var tempFile = File1.fullName;
... View more
Oct 26, 2017
12:17 PM
2 Upvotes
blend_if(0,0, 255,255, 0,0, 0,255, "k"); //////////////////////////////////////////////////////////////////////////////////////////// function blend_if(db0,db1, dw0,dw1, sb0,sb1, sw0,sw1, ch) { try { if (db0 == undefined) db0 = 0; if (db1 == undefined) db1 = db0; if (dw0 == undefined) dw0 = 255; if (dw1 == undefined) dw1 = dw0; if (sb0 == undefined) sb0 = 0; if (sb1 == undefined) sb1 = sb0; if (sw0 == undefined) sw0 = 255; if (sw1 == undefined) sw1 = sw0; if (ch == undefined) ch = "krgb"; var use_r = false; var use_g = false; var use_b = false; var use_k = false; if (ch.indexOf("r") >= 0) use_r = true; if (ch.indexOf("g") >= 0) use_g = true; if (ch.indexOf("b") >= 0) use_b = true; if (ch.indexOf("k") >= 0) use_k = true; var desc3 = new ActionDescriptor(); var desc4 = new ActionDescriptor(); var ref1 = new ActionReference(); var list1 = new ActionList(); ref1.putEnumerated( charIDToTypeID( "Lyr " ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) ); desc3.putReference( charIDToTypeID( "null" ), ref1 ); for (var i = 0; i < 4; i++) { var desc5 = new ActionDescriptor(); var ref2 = new ActionReference(); use_cont = false; switch ( i ) { case 0: if (!use_k) { use_cont = true; break; } ref2.putEnumerated( charIDToTypeID( "Chnl" ), charIDToTypeID( "Chnl" ), charIDToTypeID( "Gry " ) ); break; case 1: if (!use_r) { use_cont = true; break; } ref2.putEnumerated( charIDToTypeID( "Chnl" ), charIDToTypeID( "Chnl" ), charIDToTypeID( "Rd " ) ); break; case 2: if (!use_g) { use_cont = true; break; } ref2.putEnumerated( charIDToTypeID( "Chnl" ), charIDToTypeID( "Chnl" ), charIDToTypeID( "Grn " ) ); break; case 3: if (!use_b) { use_cont = true; break; } ref2.putEnumerated( charIDToTypeID( "Chnl" ), charIDToTypeID( "Chnl" ), charIDToTypeID( "Bl " ) ); break; } if (use_cont) continue; desc5.putReference( charIDToTypeID( "Chnl" ), ref2 ); desc5.putInteger( charIDToTypeID( "SrcB" ), sb0 ); desc5.putInteger( charIDToTypeID( "Srcl" ), sb1 ); desc5.putInteger( charIDToTypeID( "SrcW" ), sw0 ); desc5.putInteger( charIDToTypeID( "Srcm" ), sw1 ); desc5.putInteger( charIDToTypeID( "DstB" ), db0 ); desc5.putInteger( charIDToTypeID( "Dstl" ), db1 ); desc5.putInteger( charIDToTypeID( "DstW" ), dw0 ); desc5.putInteger( charIDToTypeID( "Dstt" ), dw1 ); list1.putObject( charIDToTypeID( "Blnd" ), desc5 ); } desc4.putList( charIDToTypeID( "Blnd" ), list1 ); desc3.putObject( charIDToTypeID( "T " ), charIDToTypeID( "Lyr " ), desc4 ); executeAction( charIDToTypeID( "setd" ), desc3, DialogModes.NO ); } catch (e) { alert(e); } }
... View more
Oct 26, 2017
07:01 AM
// run this script var dlg = new Window("dialog", ""); // HERE IS EXAMPLE CODE FROM "JAVASCRIPT TOOLS GUIDE.pdf" FOR CREATIVE CLOUD // create list box with two titled columns var list = dlg.add ('ListBox', [0, 0, 150, 75], 'asd', {numberOfColumns: 2, showHeaders: true, columnTitles: ['First Name', 'Last Name']}); // add an item for the first row, with the label value for the first column var item1 = list.add ('item', 'John'); // add the label value for the second column in that row. item1.subItems[0].text = 'Doe'; // END OF EXAMPLE dlg.show(); // line // item1.subItems[0].text = 'Doe'; // cause an error on PS CC2015.5 and CC2018 // WTF ?
... View more
Oct 25, 2017
02:31 AM
do in such way app.activeDocument.activeLayer = app.activeDocument.layers.getByName(actLay.name);
... View more
Oct 24, 2017
04:42 PM
maybe so ? var dir = "C:\\SomeFOLDER\\WorkingDir"; //or use single slash: var dir = "C:/SomeFOLDER/WorkingDir"; var scripts_dir = "C:\\SomeFOLDER\\YourScriptsFolder"; ///////////////////////////////////////////////////////////////////////////// function f(file_name, script_name) { try { app.open(dir + "\\" + file_name); var __doc = app.activeDocument; $.evalFile(scripts_dir + "\\" + script_name); __doc.close(SaveOptions.SAVECHANGES); } catch (e) { alert(e); } } ///////////////////////////////////////////////////////////////////////////// e("Photo 1.jpg", "Script 2" ) e("Photo 2.jpg", "Script 6" ) e("Photo 3.jpg", "Script 3" ) e("Photo 4.jpg", "Script 1" ) e("Photo 5.jpg", "Script 10") // and so on... // or put this lines into some file.txt and uncomment next line // $.evalFile("file.txt");
... View more
Oct 23, 2017
01:59 AM
1 Upvote
You can add a rectangular linked vector mask with zero density to the original layer, not an objectively smart object, with dimensions as the layer. Then, after any transformation or rotation, you can calculate the angles and dimensions using 4 points of the vector mask. I'm not sure that it will be convenient for you. ps. hope you understand my poor english )
... View more
Oct 21, 2017
03:00 PM
3 Upvotes
on CC2018 it works, on CS6 do not. function get_smart_object_corners() returns array from 4 corner-points (x,y) of smart object in pixels (value with floating point) you can caclulate angle and vertical or horisontal dimentions. )) Code example: //////////////////////////////////////////////////////////////////////////////////////////// var points = get_smart_object_corners(); var w = points[0][0] - points[1][0]; var h = points[0][1] - points[1][1]; var angle = Math.atan(h/w) * 180.0 / Math.PI; alert ("Angle is " + angle.toFixed(3) + "°"); //////////////////////////////////////////////////////////////////////////////////////////// function get_smart_object_corners() { try { var r = new ActionReference(); r.putEnumerated( charIDToTypeID( "Lyr " ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) ); var d; try { d = executeActionGet(r); } catch (e) { alert(e); return; } try { d = d.getObjectValue(stringIDToTypeID("smartObjectMore")); } catch (e) { alert(e); return; } try { d = d.getList(stringIDToTypeID("transform")); } catch (e) { alert(e); return; } var ret = [[d.getDouble(0),d.getDouble(1)], [d.getDouble(2),d.getDouble(3)], [d.getDouble(4),d.getDouble(5)], [d.getDouble(6),d.getDouble(7)]]; return ret; } catch (e) { alert(e); } }
... View more
Oct 21, 2017
09:17 AM
to preserve history use app.activeDocument.suspendHistory function. app.activeDocument.suspendHistory("Redraw", "redraw_doc()");
... View more
Oct 21, 2017
08:58 AM
You can try my vertion of redraw_doc() function. May be faster ) //////////////////////////////////////////////////////////////////////////////////////////// var _redraw_doc_id; //////////////////////////////////////////////////////////////////////////////////////////// function redraw_doc() { try { if (_redraw_doc_id != app.activeDocument.id) { _redraw_doc_id = app.activeDocument.id; showAll(); } step_by_step(); if (!app.activeDocument.guides.length) { clear_guides(); } else { show_guides(); } accelerated(); } catch (e) { accelerated(); refresh(); } } //////////////////////////////////////////////////////////////////////////////////////////// function menu(type_str, force_str, dlg, err_ctrl) { try { var id = (type_str.length==4) ? charIDToTypeID(type_str) : stringIDToTypeID(type_str); if (force_str == true) id = stringIDToTypeID(type_str); var r = new ActionReference(); var d = new ActionDescriptor(); var ret = true; try { r.putEnumerated( charIDToTypeID( "Mn " ), charIDToTypeID( "MnIt" ), id ); d.putReference( charIDToTypeID( "null" ), r ); executeAction( charIDToTypeID( "slct" ), d, dlg==true?DialogModes.ALL:DialogModes.NO ); } catch(e) { if (err_ctrl) alert(e); ret = false; } r = null; d = null; return ret; } catch (e) { alert(e); throw(e); } } //////////////////////////////////////////////////////////////////////////////////////////// function showAll() { try { menu("showAll"); menu("TgGr"); menu("toggleLayerEdges"); menu("toggleSlices"); } catch (e) { alert(e); throw(e); } } //////////////////////////////////////////////////////////////////////////////////////////// function clear_guides() { try { var d = new ActionDescriptor(); var r = new ActionReference(); r.putEnumerated( charIDToTypeID( "Gd " ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Al " ) ); d.putReference( charIDToTypeID( "null" ), r ); executeAction( charIDToTypeID( "Dlt " ), d, DialogModes.NO ); d = null; r = null; } catch (e) { alert(e); throw(e); } } //////////////////////////////////////////////////////////////////////////////////////////// function show_guides() { try { var d1 = new ActionDescriptor(); var d2 = new ActionDescriptor(); d2.putUnitDouble( charIDToTypeID( "Pstn" ), charIDToTypeID( "#Prc" ), 200 ); d2.putEnumerated( charIDToTypeID( "Ornt" ), charIDToTypeID( "Ornt" ), charIDToTypeID( "Hrzn" ) ); d1.putObject( charIDToTypeID( "Nw " ), charIDToTypeID( "Gd " ), d2 ); executeAction( charIDToTypeID( "Mk " ), d1, DialogModes.NO ); app.activeDocument.guides[app.activeDocument.guides.length-1].remove(); d1 = null; d2 = null; } catch (e) { alert(e); throw(e); } } //////////////////////////////////////////////////////////////////////////////////////////// function accelerated() { try { var d1 = new ActionDescriptor(); var d2 = new ActionDescriptor(); var r1 = new ActionReference(); r1.putProperty( charIDToTypeID( "Prpr" ), charIDToTypeID( "PbkO" ) ); r1.putEnumerated( charIDToTypeID( "capp" ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) ); d1.putReference( charIDToTypeID( "null" ), r1 ); d2.putEnumerated( stringIDToTypeID( "performance" ), stringIDToTypeID( "performance" ), stringIDToTypeID( "accelerated" ) ); d1.putObject( charIDToTypeID( "T " ), charIDToTypeID( "PbkO" ), d2 ); executeAction( charIDToTypeID( "setd" ), d1, DialogModes.NO ); r1 = null; d2 = null; d1 = null; } catch (e) { throw(e); } } //////////////////////////////////////////////////////////////////////////////////////////// function step_by_step() { try { var d1 = new ActionDescriptor(); var d2 = new ActionDescriptor(); var r1 = new ActionReference(); r1.putProperty( charIDToTypeID( "Prpr" ), charIDToTypeID( "PbkO" ) ); r1.putEnumerated( charIDToTypeID( "capp" ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) ); d1.putReference( charIDToTypeID( "null" ), r1 ); d2.putEnumerated( stringIDToTypeID( "performance" ), stringIDToTypeID( "performance" ), stringIDToTypeID( "stepByStep" ) ); d1.putObject( charIDToTypeID( "T " ), charIDToTypeID( "PbkO" ), d2 ); executeAction( charIDToTypeID( "setd" ), d1, DialogModes.NO ); r1 = null; d2 = null; d1 = null; } catch (e) { throw(e); } }
... View more
Oct 21, 2017
07:56 AM
Try to use such function instead of app.refresh() function clear_guides() { try { var d = new ActionDescriptor(); var r = new ActionReference(); r.putEnumerated( charIDToTypeID( "Gd " ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Al " ) ); d.putReference( charIDToTypeID( "null" ), r ); executeAction( charIDToTypeID( "Dlt " ), d, DialogModes.NO ); d = null; r = null; } catch (e) { alert(e); throw(e); } } On CS6 it very fast redraw current doc (when in step-by-step mode))
... View more
Oct 21, 2017
06:39 AM
1 Upvote
monica.L написал(а) By determine the height of my words, I would not overlay other textitems. May be more useful is to determine hieight of total text in such way text_height = app.activeDocument.activeLayer.bounds[3] - app.activeDocument.activeLayer.bounds[1]; ?
... View more
Oct 21, 2017
04:26 AM
Try to set manualy in actions panel or via srcipt "PlaybackOptions performance" to stepByStep. And don't use refresh().
... View more
Oct 20, 2017
05:47 AM
you need to activate some element in dialog. insert one more line like this dlg.msgEt.active = true;
... View more
Oct 20, 2017
05:23 AM
before line with dlg.show() insert such code function key_handle(e) { switch (e.keyIdentifier) { case "Enter": dlg.btnPnl.buildBtn.notify(); break; } } dlg.addEventListener ("keydown", key_handle, false);
... View more
Oct 20, 2017
12:28 AM
use such function instead of guides.removeAll() function clear_guides() { try { var d = new ActionDescriptor(); var r = new ActionReference(); r.putEnumerated( charIDToTypeID( "Gd " ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Al " ) ); d.putReference( charIDToTypeID( "null" ), r ); executeAction( charIDToTypeID( "Dlt " ), d, DialogModes.NO ); d = null; r = null; } catch (e) { alert(e); throw(e); } }
... View more
Feb 02, 2015
01:07 PM
2 Upvotes
Does Adobe know about bug with Luquify Filter and Fill Layers when they are shown as backdrop. Especially (but not the rule) reproduced on high rez files, e.g. 5000x5000 or higer. When you try to show backdrop the solid color layer often you see transparency, or black, or white instead or real layer color. This can be reproduced on ps cs2, cs3 and cs6 x32 and x64.
... View more
Apr 25, 2014
12:40 PM
All of this begun after this update
http://blogs.adobe.com/photoshopdotco...
So after this:
"Notable Windows specific bugs fixed
...
Pen tool input doesn’t draw correctly
"
What was that bug? I dont know about it. All day long i work with pen tool.
And know the bug even on PS 14.2.1 incorrect pen output when GPU is off and "constrain path draggig" if off.
... View more
Apr 24, 2014
01:09 PM
Try to reproduce pen lag useing PS on any vmware machine with win7.
... View more
Apr 11, 2014
02:31 PM
/////////////////////////////////////////////////////////////////////////////////////////////////// function select_pentool(name) { try { var desc = new ActionDescriptor(); var ref = new ActionReference(); ref.putClass( stringIDToTypeID( "penTool" ) ); desc.putReference( charIDToTypeID( "null" ), ref ); executeAction( charIDToTypeID( "slct" ), desc, DialogModes.NO ); ref = null; desc = null; //reset_tool(); if (name) select_preset(name); } catch (e) {} } /////////////////////////////////////////////////////////////////////////////////////////////////// function select_preset(name) { try { var desc = new ActionDescriptor(); var ref = new ActionReference(); ref.putName( stringIDToTypeID( "toolPreset" ), name ); desc.putReference( charIDToTypeID( "null" ), ref ); executeAction( charIDToTypeID( "slct" ), desc, DialogModes.NO ); ref = null; desc = null; } catch(e) { } }
... View more
Apr 10, 2014
03:57 PM
Can`t use pen tool on windows7(x86) on ps 13.0.1.2. and 13.0.1.3 because of hard lags and delay on mouse left click. These lags are also presents on cloud version of ps cs6 (13.1.2) and on all versions of ps cc include 14.1.2. On ps 13.0.1.1 and earlier there is no any pen lags.
Will be there any fix? Do you know about this ploblem?
p.s. sorry for my english.
... View more
Apr 10, 2014
03:43 PM
Then try to reproduce it on their systems or similar )
I also reported this problem
http://feedback.photoshop.com/photosh...
And no answer...
... View more
Nov 14, 2013
03:04 PM
OK. I`ve noticed that bug first on 13.0.1.2 Release notes Notable Windows specific bugs fixed Photoshop fails to launch on a limited user account system due to locked default scratch disk Pen tool input doesn’t draw correctly Improved Windows 8 tablet support What do they done with pen tool? They breaked it. Return all back! What was incorrect with pen tool? Theay just brake it of. p.s. sorry, my english is not good. p.s.s, bug with ps help call i have seen even on ps7 on win98. But it was not such annoying as that with pen tool.
... View more
Nov 14, 2013
02:25 PM
JurajVT, glad for you. But i still have this lag bug even on 14.1.2 ps on win7(x86). On ps 13.0.1.1 there is no any lags. BUT(!). You can reproduce a similar lag (not such strong) when you create a file e.g. 4000x4000 or larger then turn on View->Show->Layer Egdes and then try to do something with pen tool. p.s. ADOBE, psz, make the FIX!
... View more
Nov 14, 2013
02:01 PM
JurajVT wrote: After newest updates I have no this problem anymore. All is O.K. What is the "newest updates" for you? And what is your OS? I have this lag on PS 13.0.1.2, 13.0.1.3, 13.1.2 an on 14.1.2 on windows7.
... View more
- « Previous
- Next »