Go Back   RetouchPRO > Tools > Software > Photoshop Scripting
Register Blogs FAQ Site Nav Search Today's Posts Mark Forums Read

Photoshop Scripting Learning and sharing for all platforms

Making sense out of ScriptListner

Thread Tools
Old 01-04-2005, 10:13 AM
byRo's Avatar
byRo byRo is offline
Senior Member
Join Date: May 2004
Location: Goianésia, Brazil
Posts: 1,609
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....
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 );
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 );
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!!

Reply With Quote top
Old 01-04-2005, 11:07 AM
babedieboe babedieboe is offline
Junior Member
Join Date: Dec 2004
Posts: 14
sounds nice. keep us up to date m8! thx
Reply With Quote top

  RetouchPRO > Tools > Software > Photoshop Scripting

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
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 Off
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 08:59 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
Copyright © 2016 Doug Nelson. All Rights Reserved