Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects how to focus();

  • how to focus();

    Posted by Chortorn on March 22, 2007 at 9:35 pm

    I have written a script, which builds a UI for something. Is it possible to set focus to a textfield? I would have thought that obj.focus() should do the trick.

    Chortorn

    Chortorn replied 19 years, 1 month ago 2 Members · 5 Replies
  • 5 Replies
  • Filip Vandueren

    March 23, 2007 at 3:39 am

    Looks like it can’t be done.
    The focus() Method certainly does not exist…

    I have some weird idea about perhaps setting the textselection property of your text-object (wich is read/write and should contain the string that is selected in that text-object, or an empty string) to itself…
    Can’t test that right now.
    Could you pursue and see if it works ?

    Anyway, a LOT of stuff in the “Bridge Javascript” PDF simply doesn’t work in After Effects, so it might be a waste of time…

  • Chortorn

    March 23, 2007 at 3:42 pm

    I have tried a couple of things, but cannot figure out if the problem can be solved, and I feel a little too unexperienced to think of possible workarounds.

    Maybe the main idea can be made up in an other way:
    The idea is to be able to add an effect faster than rightclicking a layer and so on, and even faster than the presets and effects menu, which does also include the use of the mouse. I wanted to be able to call a script from a shortcut, type a number and thereby identify an effect (out of perhabs 20 effects, which I do constantly apply) and hit enter. The enter-part could probably be done with the onChange() function, but focusing the tiny textfield 167 times a day would annoy my brain.

    Chortorn

  • Filip Vandueren

    March 23, 2007 at 4:28 pm

    If there’s just 1 textfield in your UI, it should automatically have focus, does the panel or window stay on screen after applying the effect ?

    Perhaps you can just create a script that opens a dialog where you enter the number, hit enter: the dialog closes and applies your favourite effect, and the next time you start the script, a fresh dialog appears.

  • Filip Vandueren

    March 23, 2007 at 10:56 pm

    to clarify, that would be a ‘prompt’ not a dialog.

  • Chortorn

    March 27, 2007 at 2:28 pm

    ‘Prompt’ solved the problem. Thank you a lot, it will make my life easier. I would actually like to write more than just one line, to show that I really am happy that you spend your time writing this trick…
    really cool.

    Chortorn

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy