RetouchPRO

Go Back   RetouchPRO > Tools > Software > Photoshop Scripting

Notices

Photoshop Scripting Learning and sharing for all platforms

Reply
 
LinkBack Thread Tools
  #1  
Old 01-04-2005, 10:13 AM
byRo's Avatar
Moderator
 
Join Date: May 2004
Location: Goiânia, Brazil
Posts: 1,549
Lightbulb Making sense out of ScriptListner

One of the things I was working on (before my computer got knicked! ) was a library of scipting commands taken from the ScriptListner listings.
This post by babedieboe reminded me ....

Basically if you turn the "id.." stuff into constants and try to give a useful name to the "desc..." stuff you can reorganize the commands into a more understandable, and re-usable format.

The script (listing) posted comes out as....
Quote:
Originally Posted by NewScript
// define constants
// ======================================================
var MAKE = charIDToTypeID( "Mk " ); // Make new object
var NEWO = charIDToTypeID( "Nw " ); // New object
var POSN = charIDToTypeID( "Pstn" );// Position
var NPXL = charIDToTypeID( "#Pxl" );// Number of Pixels
var ORNT = charIDToTypeID( "Ornt" );// Orientation
var VERT = charIDToTypeID( "Vrtc" );// Vertical
var HORZ = charIDToTypeID( "Hrzn" );// Horizontal
var GUID = charIDToTypeID( "Gd " ); // Guide

// set guidelines at 50% on X & Y
// =======================================================
var doc = app.activeDocument;

var GUIDE = new ActionDescriptor();
var PLACE = new ActionDescriptor();
PLACE.putUnitDouble( POSN, NPXL, doc.width/2 );
PLACE.putEnumerated( ORNT, ORNT, VERT );
GUIDE.putObject( NEWO, GUID, PLACE );
executeAction( MAKE, GUIDE, DialogModes.NO );

// =======================================================
var GUIDE = new ActionDescriptor();
var PLACE = new ActionDescriptor();
PLACE.putUnitDouble( POSN, NPXL, doc.height/2 );
PLACE.putEnumerated( ORNT, ORNT, HORZ );
GUIDE.putObject( NEWO, GUID, PLACEMENT );
executeAction( MAKE, GUIDE, DialogModes.NO );

// end guidelines=========================================
Unfortunately I can't test this (don't have scripts here), but I think you'll get the idea.
This "make guide" command is just an example, if you do the same for the "make line" command, then the fun starts!!

byRo
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Float This Post!Stumble this Post!Google Bookmark this Post!Yahoo Bookmark this Post!Live Bookmark this Post!Share this post on Facebook
Reply With Quote
  #2  
Old 01-04-2005, 11:07 AM
Junior Member
 
Join Date: Dec 2004
Posts: 14
sounds nice. keep us up to date m8! thx
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Float This Post!Stumble this Post!Google Bookmark this Post!Yahoo Bookmark this Post!Live Bookmark this Post!Share this post on Facebook
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to lighten image with making it look washed out? measuri Image Help 9 04-09-2007 04:43 PM
Making an image brighter Nature1 Image Help 5 11-12-2006 03:42 PM
Making Composite Look Natural Duv Image Help 7 12-22-2004 05:33 PM
Making a slideshow on Mac winwintoo Photoshop Elements Help 2 12-01-2003 06:54 AM
tip for making a mask winwintoo Photo Compositing 3 05-22-2002 08:16 PM


All times are GMT -6. The time now is 01:27 AM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
Copyright © 2008 Doug Nelson. All Rights Reserved




1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51