Home Download Buy Blog Forum Support

OS path in menu

OS path in menu

Postby LONGMAN on Wed Mar 13, 2013 3:00 pm

How I can type OS path in Main.sublime-menu?
Code: Select all
"command": "open_file",
"args": {"file": "${os_path}/drivers/etc/hosts"

Its not works
AutoBackups: ST2 / ST3
CodeFormatter: ST2 / ST3
StringUtilities: ST2 / ST3
LONGMAN
 
Posts: 68
Joined: Mon Nov 26, 2012 5:03 pm
Location: Tbilisi, Georgia

Re: OS path in menu

Postby LONGMAN on Thu Mar 14, 2013 6:55 pm

Any ideas?
AutoBackups: ST2 / ST3
CodeFormatter: ST2 / ST3
StringUtilities: ST2 / ST3
LONGMAN
 
Posts: 68
Joined: Mon Nov 26, 2012 5:03 pm
Location: Tbilisi, Georgia

Re: OS path in menu

Postby jps on Fri Mar 15, 2013 12:22 am

What are you expecting ${os_path} to do?
jps
Site Admin
 
Posts: 3077
Joined: Wed Mar 19, 2008 12:33 pm

Re: OS path in menu

Postby LONGMAN on Fri Mar 15, 2013 8:58 am

jps wrote:What are you expecting ${os_path} to do?

Return string "C:\Windows"
because
Code: Select all
"command": "open_file",
"args": {"file": "C:/Windows/drivers/etc/hosts"

not works
AutoBackups: ST2 / ST3
CodeFormatter: ST2 / ST3
StringUtilities: ST2 / ST3
LONGMAN
 
Posts: 68
Joined: Mon Nov 26, 2012 5:03 pm
Location: Tbilisi, Georgia

Re: OS path in menu

Postby jps on Fri Mar 15, 2013 10:10 am

You may have luck with /C/Windows/drivers/etc/hosts
jps
Site Admin
 
Posts: 3077
Joined: Wed Mar 19, 2008 12:33 pm

Re: OS path in menu

Postby bizoo on Fri Mar 15, 2013 10:14 am

jps wrote:You may have luck with /C/Windows/drivers/etc/hosts

Any chances to have an API method to do the conversion ?
bizoo
 
Posts: 889
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: OS path in menu

Postby LONGMAN on Fri Mar 15, 2013 11:13 am

jps wrote:You may have luck with /C/Windows/drivers/etc/hosts

Thanks. It works
AutoBackups: ST2 / ST3
CodeFormatter: ST2 / ST3
StringUtilities: ST2 / ST3
LONGMAN
 
Posts: 68
Joined: Mon Nov 26, 2012 5:03 pm
Location: Tbilisi, Georgia

Re: OS path in menu

Postby urosevic on Sat Nov 16, 2013 4:06 pm

jps wrote:You may have luck with /C/Windows/drivers/etc/hosts


I know that I'm "bringing from death" this topic, but I must :) Thanks @jps for precise and so easy solutionQ I add next code to Main.sublime-menu (on Windows 7) and now it works like a charm:

Code: Select all
   {
      "caption": "Tools",
      "mnemonic": "t",
      "id": "tools",
      "children":
      [
         { "command": "open_file", "caption": "Edit hosts", "mnemonic": "h", "args": {"file":"/C/Windows/System32/drivers/etc/hosts"}}
      ]
   }


Cheers
urosevic
 
Posts: 2
Joined: Sat Nov 16, 2013 3:59 pm
Location: Kragujevac, Serbia


Return to Technical Support

Who is online

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