XToolkit Beta2

Discussion of the xtools Toolkit

Moderators: Tom, Kukurykus

xbytor

XToolkit Beta2

Post by xbytor »

Finally. Lots of new stuff, lots of old stuff. The README file in xtools/xapps has all of the portability notes, except for the fact that I have no idea how all of this behaves on a Mac. This thread will be for any items that come up with Beta 2. Let me know how it works for you.

If nobody here finds anything serious in the next couple of days, I'll drop a note out on adobeforums so it gets a broader audience.

I do not plan on adding any additional functionality between now and the 1.0 release. I will only be fixing bugs that crop up, making usability changes, and adding documentation.

This distribution is rather large because of the new 'apps' directory that contains flattened version of all the scripts in xapps. That directory will be posted in parts in follow-on posts. You can reassemble the zip file using the 7Zip application available here: http://www.7-zip.org.

Enjoy.
xbytor

XToolkit Beta2

Post by xbytor »

It turns out I can only post zip files, not split zip files. I'll try and get them posted up tomorrow. In the meantime, the Flatten script can flatten them for you if you tweak the necessary includepath directives.
xbytor

XToolkit Beta2

Post by xbytor »

Here's a useful README file for the scripts in the xapps directory.

Code: Select allREADME for xtools/xapps
$Id: README,v 1.5 2005/11/08 13:18:29 anonymous Exp $

This directory contains application scripts. These scripts may be run directly
from the File->Scripts menu. As a part of the installation process, an
ActionSet called XToolkit is loaded into Photoshop containing an Actions that
invoke these scripts.

These scripts are divided into three categories: Tookit Scripts and Sample
Scripts.

=============================== Toolkit Scripts ==============================

The scripts in this section are useful for the intenedd audience of this
tookit: other Photoshop Javasript authors.

jsh.js - CS,CS2
        This is my most indispenible tool. It is an interactive command line
        shell (sort of) for executing javascript code within Photoshop. I use
        whenever I am writing new code.


ActionFileToXML.js - CS2
ActionFileFromXML.js - CS2
        The two scripts convert Action (.atn) Files to and from XML. This
        capability makes it possible to edit actions as:
                - ActionDescriptor constructs
                - XML DOM objects
                - strings
        ActionFileFromXML has sample code in it (in comments) that shows how
        to change the paths of all scripts in an action file to a new
        directory.

ActionToJavascript.jsx -CS2
        This script translates an Action file to a Javascript file with
        contains a JS function per Action. Additional code in this file
        shows how to convert a single action as well. Given the rest of the
        facilities availble, translating from XML to javascript would be
        an easy extension to make.

ActionLister.js - PS7,CS,CS2
        This script reads the runtime ActionsPalette for a list of all
        ActionSets and Actions. The class definitions that this information
        is put into is copied from xlib/Action.js. The Action Sets and Actions
        are listed in a window.

ActionStepper.js - PS7,CS,CS2
        ActionStepper runs all of the Actions in an ActionSet on the current
        document. After an action is run, the new image is saved and the
        document is reverted to is prior state before running the next action.
        This is useful for things ActionSets like Image Effects or Frames.
        If action's in the set require having a selection prior to running the
        action, you should probably move them to a different action set and run
        those with an active selection.

BackupActionsPalette.js - CS2
        After bashing my ActionsPalette a couple of times while developing
        some Action management routines, I wrote this script that makes
        backing up my ActionsPalette a simple mouse click. With my luck, I
        should probably hotkey the Action that calls this script as well.

ChangeScriptPaths.jsx - CS2
        This script will convert all all script paths in an Action File to
        a new path. This lets you move all your scripts to a new directory
        then change the Action File with this script so that everywhere they
        are called gets changed to this directory.

DropletDecompiler.js - CS2
        Ever compile a droplet and then 'lose' the Action you used to generate
        it? I have, more than once. It suX0Rs. So I wrote this. It can recover
        that Action from the droplet. It worked for the one testcase I tried,
        so I'm not making any promises...

Flatten.js - PS7,CS,CS2
        This script is great as part of packaging scripts for deployment. This
        will flatten the include file hierarchy of an application script so
        that you end up with one huge file, instead of several smaller ones.

FontLister.js - CS,CS2
        All of the information about fonts that can be determined from the
        Javascript side is accessed here. For each font, the lister returns
        the font's name, postscript name, family, and style. The 'main'
        routine calls the functions to retrieve all of this information, then
        writes it out in CSV format to a window.

PresetLister.js - PS7,CS,CS2
        This is another Lister script that lists out all of the currently
        loaded brushes, colors, gradients, styles, patterns, shaping curves,
        custom shapes, and tool presets. The 'main' function writes this info
        out to a text file. Scripts developed by other people could probably
        find something more useful to do with this information.

SLCFix.js - PS7,CS,CS2
        ScriptingListener code is mostly functional and complete unsightly.
        Running this converts all of that stuff into something far more
        readable and reusable.

Install.js
        This is the installation script for XToolkit. It's not all that complex
        except for the part where a new .atn file is created by modifying an
        existing one.


================================= Demo Scripts ===============================

These scripts show how different parts of the toolkit can be used. Most of the
scripts here were written to support my workflow. Some are 'old' and may be a
bit rusty in places. They are provided here as examples, not finished products.

Compatibility Issues:
The Photoshop version these scripts work with follow their name. Some of these,
particularly the Action focused scripts, don't work because of a missing API or
interpreter problems. These I may be able to fix. Other scripts, like LogWindow
and jsh will never work in PS7 because the UI components just don't exist
in that version. Othere scripts, such as Cnvt and Resize by default use a
plugin that I have on my machine, the IM StairStep Resize plugin. The don't
require. You can go in and change the options to make it use some other
resizing technique. I just happen to like this plugin a lot so I default to it.
Most of these scripts will let you know if it they don't work in your version
of Photoshop or if you don't have a plugin, shape, or style that is expected.

ActionRunnerDemo.js - CS,CS2
        This demo script shows how to use the ActionRunner class. ActionRunner
        loads an Action from either an XML or Action file and runs it from the
        JS interpreter. This is good for several reasons:
        1) You can have a script run an action that calls a script. Finally.
        2) You can run actions that have not been loaded into the runtime
           Actions Palette.
        3) There is a neat little extension for 'Stop' Action Items. If the
           message in the Stop item begins with '//!JSXScript' it marks the
           message as a Scriptlet, and interprets it has Javascript. This will
           featur will be documented in more detail later.

ColorBookDemo.js - CS,CS2
        A ColorBook, in PS-speak, is a stored color palette. This script reads
        all of the color books from 'Presets/Color Books' and writes what
        information it can out to a text file.

GetterDemo.jsx - CS2
        This script accesses just everything that can be reached from the
        Javascript API. This includes:
                - Application Info
                    (Preferences, PresetManager Info, Fonts, etc...)
                for each open document
                  - Document Info
                  - Background Info
                  - Layer Info
                  - Channel Info
                  - Path Info
                  - History Info

        If you can get information you want from the Javascript API, take a
        look at the output of this script. This has everything you can get to,
        although you do have to go through the ActionDescriptor API to get at
        it.

LogWindowDemo.js - CS,C2S
        The first piece of PSJS-UI code that I wrote was this class. I like to
        log stuff to screen or file or whatever when I'm debugging. This works
        pretty well for that. I've reused it a lot.

============================= Application Scripts ============================

There rest of these scripts were written to support my specific needs. A lot of
my work last year was in attempting to make older digitial camera images (from
1996 on) more presentable as well as cataloging, updating metatdata, etc...
While it is unlikely that any of these scripts will be directly useful to
anybody, the may help to illustrate how different parts of the toolkit and
the Photoshop Javascript API can be utilized.

AddWatermark.js - PS7,CS,CS2
        This script is a descendent of the first non-trivial script I wrote in
        Photoshop. There is no user interface to speak of. It's all configured
        by code. There is support for saved options, but I don't know if that
        still works. Looks for a shape called 'Watermark Shape' and a style
        called 'Watermark style'.

AdjustLevels.js - PS7,CS,CS2
AdjustRGBLevels.js - PS7,CS,CS2
        These are some alternatives to the Auto Levels facilities in PS. The
        major innovation here is that you can specify how much to clip in the
        shadows and in the highlights, kinda what you would normally do with
        the sliders in the Levels dialog. These alternatives don't do quite the
        'adjustment' to your colors that the normal Auto Levels sometimes does.

Cnvt.js - CS,CS2
        This is an export-style script. After I've completed tweaking a set of
        images, I run this script to add a watermark and then save out to some
        set of image types and sizes. Uses the IM StairStep plugin, by default.

Normalilze.js - CS,CS2
        This script imports images and 'normalizes' them so that they have
        consistent metatdata, color profile, bit depth, size, etc... A noise
        reduction action may also be run as a part of the normalization
        process. Uses the IM StairStep plugin, by default.

Resize.js - PS7,CS,CS2
        A simple example of calling code in xlib/ResizeImage.js. Uses the
        IM StairStep plugin, by default.

UpdateMetadata.js - PS7,CS,CS2
        A basic script for updating metadata.

EOF
Andrew

XToolkit Beta2

Post by Andrew »

Hi X

Looking forward to exploring these. What was the problem with uploading the files - if the extension was .zip it should have been fine, if it was something else I can change the permissions to allow those.

Andrew
xbytor

XToolkit Beta2

Post by xbytor »

7Zip splits up a zip file into parts and appends a 3 digit index number. If you open up the first one with it looks like one big zip file. For instance, it I had a 1 megabyte zip that I split into 256k sized chunks, I would end up with:
xtools.zip.001
xtools.zip.002
xtools.zip.003
xtools.zip.004

Similar to a rar split, or Unix split(1).

I'll see if I can find away to partition the files up into separate zips manually. It will keep the confusion down to a minimum.
xbytor

XToolkit Beta2

Post by xbytor »

xtools/apps part 1
xbytor

XToolkit Beta2

Post by xbytor »

xtools/apps part 2
xbytor

XToolkit Beta2

Post by xbytor »

xtools/apps part 3 of 4
xbytor

XToolkit Beta2

Post by xbytor »

xtools/apps part 4 of 4

These are all just normal zip files. This should be everything...
Guest

XToolkit Beta2

Post by Guest »

No links, only text.