Skip to content

How do I access current_token in a plugin command? #4669

Answered by lks128
lks128 asked this question in API
Discussion options

You must be logged in to vote

I tried this before, but was getting a strange error that something is not available / does not exist anymore, but now it works.

    log_info(f"address: {hex(start)} - {hex(start+end)}")
    context = UIContext.activeContext()
    print(f'context = {context}')

    action_handler = context.getCurrentActionHandler()
    print(f'action_handler = {action_handler}')

    view_frame = context.getCurrentViewFrame()
    print(f'view_frame = {view_frame}')
    
    view = context.getCurrentView()
    print(f'view = {view}')

    view_location = view_frame.getViewLocation()
    print(f'view_location = {view_location}')

    action_context = None
    if view is not None:
        action_context = view.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@psifertex
Comment options

@lks128
Comment options

@psifertex
Comment options

Answer selected by psifertex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants