Home Download Buy Blog Forum Support

[ST2] subl --command ???

[ST2] subl --command ???

Postby ljbo3 on Wed Apr 17, 2013 12:05 pm

hi,

I naively thought that the argument following command could be any command valid on the console line. However the following,

~> subl --command 'sublime.status_message("It works!")'

results in

Unable to parse command: sublime.status_message("It works!")

in ST2 console output.

This is with the latest version of ST2 on MacOS X.

Best wishes,

Luc J. Bourhis
ljbo3
 
Posts: 7
Joined: Wed Aug 15, 2012 2:23 pm

Re: [ST2] subl --command ???

Postby ljbo3 on Wed Apr 17, 2013 3:42 pm

Trials and errors lead to the conclusion that `subl --command` accepts what commands, i.e. what `run_command` accepts. So for example,

~> subl --command 'prompt_select_project'

works fine by opening the project chooser panel. But how to deal with commands taking argument, e.g. goto_line:

view.run_command('goto_line', {'line': 10})

I have tried

~> subl --command 'goto_line, {"line":15}'

and variations around that but to no avail. Would anybody know the answer to this updated question?
ljbo3
 
Posts: 7
Joined: Wed Aug 15, 2012 2:23 pm

Re: [ST2] subl --command ???

Postby quarnster on Wed Apr 17, 2013 4:15 pm

Remove the comma.
Code: Select all
subl --command 'goto_line {"line":15}'
quarnster
 
Posts: 389
Joined: Tue Nov 29, 2011 11:34 am

Re: [ST2] subl --command ???

Postby ljbo3 on Wed Apr 17, 2013 4:37 pm

Thanks!
ljbo3
 
Posts: 7
Joined: Wed Aug 15, 2012 2:23 pm


Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot], Juje007, Yahoo [Bot] and 27 guests