Clearing the Adobe ExtendScript ToolKit Console Window
While creating a new JavaScript to automate some day-job Photoshop work, I gave Adobe’s ExtendScript Toolkit a spin. It’s designed specifically for building scripts for Adobe products and it’s pretty nice. Especially the JavaScript Console window that makes it nice and easy to see debugging messages.
By default, this window doesn’t clear itself before each run which degrades a lot of its value. It can be cleared manually before the start of each test run, but that’s a pain. The good news is there’s a way to do it with code. If the script is run from ExtendScript Toolkit itself, this snippet of code will do it:
app.clc();
Unfortunately, that same code causes Photoshop to choke which defeats the purpose. The first solution I came up with to get around this is to check to make sure the script was being run in ExtendScript ToolKit before making the call.
if (app.name === "ExtendScript Toolkit") {
app.clc();
}
This clears the console when run in ExtendScript ToolKit but not Photoshop. Useful for early stage development but resulting in having to fall back to manually clearing after each Photoshop run. After some digging through the “Interapplication Communication with Scripts” chapter of the “JavaScript Tools Guide CS6” docs, I came up with this:
if (app.name === "ExtendScript Toolkit") {
app.clc();
}
else {
var estApp= BridgeTalk.getSpecifier("estoolkit");
if(estApp) {
var bt = new BridgeTalk;
bt.target = estApp;
bt.body = "app.clc()";
bt.send();
}
}
This code checks to see if the script is being run from ExtendScript Toolkit. If so, it clears the console natively. If the script is being run in another app (e.g. Photoshop), it attempts to send the clear message to ExtendScript Toolkit.
An alternate way to clear the console would be to use the Cmd+Shift+C
hot-key combo, but I’d much rather let the script do it for me.
2014
Random Related Links
My father's flag
On Memorial Day, remembering those who served in the past and celebrating those who serve today.
- Miscellaneous
OpenDNS
The DNS service of my local ISP sucks. It looses itself quite often which is a bad trick. I've just found OpenDNS and am going to give…
- Miscellaneous
iPhone seems quite nice
okay, I wasn't all that hyped about the iPhone. It looked cool, but none of the ads I was really got my blood up. Today I was out running…
- Miscellaneous
Buying cars
A few years ago I checked out from the library one of the Motley Fool's ( http://www.fool.com ) books. I think it was The Motley Fool You…
- Miscellaneous
Viewfinderless
This probably would never have occured to me and their may already be some out there, but one of Canon's new point and shoots doesn't have…
- Miscellaneous
AWESOME example of 80s trailer
A buddy at work was talking about the movie Firefox which I'm familiar with but don't think I've ever seen. He sent me this trailer on you…
- Miscellaneous
The new blade
It has amazed me how much printer technology has imporved. I bought a $100 photo printer a couple years ago that easily bested the $5,00…
- Miscellaneous
Improvement that isn't really one?
I subscribe to a service called Safari Books Online for one of the premiere computer related book publishers: O'Reilly . Here is a snip…
- Miscellaneous
Richer Blacks
This one surprised me. I have been getting some test prints from online labs to run some comparisons. One company ( MPix ) has amoung its…
- Miscellaneous
Finding SATA Cables for SeaSonic Power Supplies
A rare case of Google not providing instant links for a product sales page.
- Miscellaneous
Sound of a Shuttle Launch
When STS-133 launched on Feb. 24, 2011 from Launch Pad 39A, I was fortunate enough to be in the VIP viewing area. At about three and half…
- Miscellaneous
A.W.S.
I think it might be a moral imparative that I do something with " Amazon Web Services ". After all, we have the same initials....
- Miscellaneous
Elgato Stream Deck Fast Forward Hotkey for Microsoft Groove
There doesn't appear to be a way to setup a Eltago Stream Deck button to fast forward songs playing in the Microsoft Groove app. Here's a…
- Miscellaneous
Photoshop Softfocus
I'm still looking for a soft focus effect in photoshop that I like. The latest one that I'm working with that I quite pleased with so far is…
- Miscellaneous
Command Line One-Liner to Compare Files with MD5
Quick bash line to compare two files via MD5
- Miscellaneous
Surprise Visitor
Moving some stuff around my garage a couple months ago I almost put my hand right into a spider's web. No big deal really, save for the type…
- Miscellaneous
Digital and Film
Just listened to a story on NPR about Herman Leonard losing a lot of his work that was in his studio due to Hurricane Katrina. Sad, but it…
- Miscellaneous
Moonlanding On Windows
Everthing changed. Or, really, I changed everything. ` I'm writing this on my new [Moonlander keyboard. It's a while ride. A split…
- Miscellaneous
Running with Lola
Watch out if you listen to the Run Lola Run soundtrack with the windows down on a nice sunny day. Some of those tracks are of the variety…
- Miscellaneous
Black and white conversion
The ability to easily convert from color to black and white is one of my favorite things about digital photography. Most of the time when I…
- Miscellaneous
The last Sunday at Reimer's
For the past five years or so there has been a Jacksonville tradition called "Sunday at Reimer's". A bunch of folks get together on Sundays…
- Miscellaneous
More thouhgts on still/motion combo cameras
Luminous Landscape just posted an article that also talks about the convergence of still and video cameras ( link ). A friend in the video…
- Miscellaneous
Pistol Report
The air pistol I order last week arrived today. I setup a little target drop and pellet trap in the living room (that's right, I'm a…
- Miscellaneous
The Density of Kanji
You can pack a lot more into a Tweet if you write in Kanji (Japanese).
- Miscellaneous
QQQDirect
I was looking for a NASDAQ index fund and came across this article about QQQDirect . It is a commission free way to do dollar-cost…
- Miscellaneous
Full Moon Prints
Starting a Wishlist on the blog as single entries. First item in the new format. A print from the "Full Moon" exhibit by Michael Light…
- Miscellaneous
Time Off
I've taken a little time off, and man, I needed it. Office holidays were for the 3rd and 4th so I took the last three days of the week of…
- Miscellaneous
Pressure
Haven't noticed this before, but I pulled up beside a cement truck the other day and saw this on their tires: I'm gussing the driver can…
- Miscellaneous