Caret handling in script

Getting back to what I asked a couple of months ago.

…is there is a way to access the next Glyph in a string, but instead of just moving the caret, to enter the editing mode (eg. double clicking).

In the video the first action I do is enter the editing mode of each glyph. The next action is moving the caret.
What line of code would enter the editing mode of the next glyph without double clicking e.g (moving the caret).

https://dl.dropboxusercontent.com/s/rvoan4vd9ri871u/caret_next.mov?dl=0

Moving the caret and double clicking does the same internally. A glyph is activ when the selection location points to it and the edit tool is active.

When in caret mode you cannot edit the paths, which is what I am after. I just want to do without the double clicking and use only the keyboard.

e.g (using Tab to cycle thru the nodes and go from there without the use of mouse altogether)

Caret mode means you have the text tool selected or the selection range is longer than zero.

My explanation isn’t really doing it justice.

I would like to access next glyph as in /View/Show Next Glyph but from a string (as seen in caret mode).
The reason for this is because Show Next Glyph and Show Prev Glyph go through all font glyphs in succession. You can throw in a Shift modifier but it still goes in succession.

I have mentioned the caret, because it is where you set a custom string. So I am hoping there is a command that I can put in macro for this?

For example : You enter a string — google

And each Show Next Glyph goes - g - o - o - g - l - e … and maybe restarts and starts - g again.

Does this makes more sense?

Well, position the caret, and activate the Select Tool. You can do that through scripting.

I didn’t thought of that. Cool.

Btw is there any place I can read how to active the tools via scripting?

Documentation is coming. Try this:

location, range = 1, 0
myRange = NSRange(location, range)

# move the cursor to location:
Doc.windowController().activeEditViewController().contentView().setSelectedRange_(myRange)

# activate Edit tool:
Doc.windowController().setSelectedToolIndex_(0)
1 Like

This is great, thanks!