Home Download Buy Blog Forum Support

Browser Preview

Re: Browser Preview

Postby burn4ever on Thu Feb 16, 2012 8:37 pm

Damm,
I did an OS X update yesterday and know the build didn´t work and no browser obens.
Anybody a clue what I have to (re)do?

The curious thing is, when I open the build-file int sublime itself it opens the browser.....
burn4ever
 
Posts: 7
Joined: Thu Feb 09, 2012 4:05 pm

Re: Browser Preview

Postby burn4ever on Fri Feb 17, 2012 7:35 am

Okay,
I´m one step closer.

If I´m saving a document to my Desktop and execute the build, it works.
It did not work, if I´m saving the document in some subfolders like /projects/web/html.

If checked to set an relative path into my buildfile but I think it´s not right cause it didn´t work ;-)

Code: Select all
{
"cmd": ["open", "-a", "/Applications/Safari.app", "$file"]
}
burn4ever
 
Posts: 7
Joined: Thu Feb 09, 2012 4:05 pm

Re: Browser Preview

Postby burn4ever on Fri Feb 17, 2012 7:45 am

Okay,
I know the problem.
I´m german...hehe ;-) The prob was that I have a Folder with an mutated vowel.
I´ve renamed it and know it works!
burn4ever
 
Posts: 7
Joined: Thu Feb 09, 2012 4:05 pm

Re: Browser Preview

Postby svenax on Fri Feb 17, 2012 9:05 am

You should just specify the application name as argument to open, not the full path. It will find the application itself using the launch services api.
svenax
 
Posts: 145
Joined: Tue Dec 20, 2011 12:47 pm

Re: Browser Preview

Postby handycam on Sat Feb 18, 2012 4:12 pm

svenax wrote:As for OS X, you really want
Code: Select all
"cmd": ["open", "-a", "Safari", "$file"]

to force Safari to open the file. You can of course substitute Google Chrome or Firefox if you want.


FWIW, it works as you have it here but with "Google Chrome" it does not work as Chrome inserts "localhost" in the path:

Code: Select all
file:///localhost/Users/handycam/Documents/survey1.html
Mac OS 10.9.3
ST 3 (3059)
handycam
 
Posts: 271
Joined: Tue Jan 03, 2012 2:42 pm

Re: Browser Preview

Postby mail3dexter on Wed Feb 22, 2012 9:16 am

Hi, what if we want to open a localhost page by doing something like this? we can open HTML pages directly but wondering if we could open php pages also by putting local host in URL somehow???
mail3dexter
 
Posts: 1
Joined: Wed Feb 22, 2012 9:11 am

Re: Browser Preview

Postby jeremyScott on Thu Feb 23, 2012 5:09 pm

Code: Select all
"cmd": ["open", "-a", "Safari", "$file"]


I'm using this and the "build results" window is opening up with '[Finished]' as the message. Is there a way to prevent the window from openeing?
Last edited by jeremyScott on Thu Feb 23, 2012 5:43 pm, edited 1 time in total.
jeremyScott
 
Posts: 6
Joined: Thu Feb 23, 2012 5:08 pm

Re: Browser Preview

Postby jeremyScott on Thu Feb 23, 2012 5:12 pm

Would it be possible to open the file in multiple browsers?
I tried this and it didn't work, obviously I'm just stabbing in the dark
Code: Select all
{
   "cmd": ["open", "-a", "Safari", "$file"],
        "cmd": ["open", "-a", "Firefox", "$file"]
}
jeremyScott
 
Posts: 6
Joined: Thu Feb 23, 2012 5:08 pm

Re: Browser Preview

Postby wdburgdorf on Thu Mar 28, 2013 1:36 pm

For me it only worked with

{
"cmd": ["c:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe", "$file"]
}


I'm new to Sublime Text, and wondering if I'll ever get used to how complicated things are here ... Is Sublime Text for the Unix-hardened only? Or is it going to get simpler someday?
wdburgdorf
 
Posts: 2
Joined: Thu Mar 28, 2013 1:32 pm

Re: Browser Preview

Postby bronson on Thu Mar 28, 2013 8:38 pm

It's JSON. See the second post in this thread for how to open the build file.
bronson
 
Posts: 38
Joined: Wed Nov 28, 2012 8:52 pm

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 15 guests