Refining a custom shortcut - specifically the Unsharp Mask
  • Hi Gus, I'm still happily using version 4.5.7 with Mavericks. 

    I'm currently in the process of photographing nearly 3000 items in a collection of mine. I have some custom shortcuts for the menu items I use frequently, but one or two of them could be a bit more helpful. For instance, the Unsharp Mask is set to open at an intensity of .50, which is way too sharp for any practical use. So in spite of opening it with a shortcut I still have to use the slider to get the right result. 

    It's probably a silly question (I'm good at those), but is there any way the slider can be preset to, say .20? Or better yet, a way of making a shortcut that will adjust the slider when it opens? Such a thing would be great, then I could have 2 shortcuts with 2 different settings. ;-)

    Thanks, Dave.



  • You could create a little custom script to set the values of your unsharp mask like this guy:

    You could change it up to look like this:

    function main(image, doc, layer) {


        var filter = [CIFilter filterWithName:"CIUnsharpMask"];


        [filter setDefaults];




        [filter setValue:image forKey:"inputImage"];


        [filter setValue:.2 forKey:"inputIntensity"];


        var filteredImage = [filter valueForKey:"outputImage"];


        


        [layer applyCIImageFromFilter:filteredImage shouldClipToSelection:true];


    }


  • Thanks for your suggestion Gus. 

    I'm no IT genius and it's way too late in life for me to try to become one. So if I could just test your patience a little more...

    Do I simply copy your script (presumably the lines "function.." down to the end) into a text file, name it "My Unsharp Setting.jstalk" and shove it in Acorn's  Plug-ins folder?

    I downloaded the SampleAcornPlugins folder, but couldn't find any instructions in there apart from one that tells me where to put it (!)

    Cheers, Dave.

    P.S. I saw the "New Image With Curved Drop Shadow.jstalk" in the Plug-ins folder, but choosing that menu item in Acorn doesn't seem to do anything but copy whatever image file I happen to have open.
  • Hmm.. well I thought that was what it said in the tutorial, but saving it as a textEdit file doesn't work. I guess it has to be compiled in some way, although I can't see any mention of that.

    Dave.


  • It doesn't have to be compiled, it just need to be saved as plain text (and with the extension .jstalk).

    Look in Console.app for errors from Acorn to help debug this.
  • Well, it is saved as plain text and it has the extension, but it doesn't show in any Acorn menu. Interestingly, in a Finder window it's identified as a Plain Text document, but the other one that's in the Plug-ins folder, the "New Image with Curved Drop Shadow" is identified simply as a document. So there's something different about them.

    As for looking in Console.app, did I mention that I'm no IT expert? I'd have to enrol in a course in computer studies before I'd even know where to look in all that hieroglyphics, let alone get any clues from it.

    Dave.
  • Well, I don't know what I did differently today, I've just re-saved your script as a plain text file and placed it in the plug-ins folder - and this time it works!

    So thanks a lot Gus. I may get a little grumpy in my dotage, but I do appreciate your help.

    Cheers, Dave.
  • Umm.. just in case I ever feel brave enough to try modifying the above plug-in, or even make one myself (there are one or two more tweaks that would be a godsend to my clicking finger), I haven't so far been able to find any instructions on how to construct jstalk plug-ins from scratch, or how the syntax works. Is there a page or a site I can go to to learn the basics?

    TIA, Dave.
  • JSTalk is JavaScript. So you'll need to learn that language (And there's more tutorials on the web than you'll ever be able to read).
    However, the difficult part is then interacting with the Cocoa APIs from Apple, specifically CoreImage.

    In general, the idea is that you'd want to duplicate an existing one and then tweak it to how you'd like it. It's not a novice thing, but it can be done.
  • Strange... I thought I answered this yesterday.

    Ah well, it was only to say that, while I appreciate where you're coming from, the only thing I had in mind was to change the plug-in you presented me with earlier, so that the inspection panel would stay open after the intensity had been set.

    As I'm a lot closer to the tail end of my life than the beginning, I don't really think I have the patience, or the time left, to start a new language. So I guess I'll just have to make the best of what there is.

    Cheers, Dave.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with OpenID