문제

I've written a script that has a couple of functions for copy and paste. I'd like to add a menu item (maybe under Edit) for both and link them to each respective function. Is this even possible? I'm using CS6 Javascript. Thanks.

An example that shows how to create a menu item that calls a function containing an alert would be very helpful.

도움이 되었습니까?

해결책 2

I don't believe so. Creating menu items requires you to create a plug-in with the Photoshop SDK. There are many examples that come with the included documentation.

다른 팁

This is the closest I've found to create a menu item. That is, scripts placed in a particular folder will be automatically found on restart, and then you can create keyboard shortcuts allowing for quicker access.)

  1. Add your script to the Preset folder (It'll be something like, C:\Program Files\Adobe\Adobe Photoshop CC 2014\Presets\Scripts)
  2. Restart Photoshop and your preset will be listed with the other scripts in the (File -> Scripts) menu.
  3. Add a keyboard shortcut to the menu item. In the (Edit -> Keyboard Shortcuts) menu, expand the (File -> Scripts) tab and follow the instructions to add shortcuts.

It is possible to create menu items by using Adobe's Generator tool. See below link for more information.

https://github.com/adobe-photoshop/generator-core

_generator.addMenuItem(id, label, true, false).then(
    function () {
        console.log("menu item added:", label)
    }, function () {
        console.error("unable to add menu item", label)
    }
);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top