Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Safari.app parameters ?

Safari.app parameters ?
Thread Tools
Dedicated MacNNer
Join Date: Mar 2002
Status: Offline
Reply With Quote
Sep 6, 2005, 08:38 PM
 
I went into Safari's package contents (/Applications/Safari.app/Contents/MacOS) and executed Safari from the command line:

./Safari
2005-09-07 02:34:29.532 Safari[1163] CFLog (0): CFMessagePort: bootstrap_register(): failed 1103 (0x44f), port = 0x3003, name = 'com.apple.Safari.ServiceProvider'
See /usr/include/servers/bootstrap_defs.h for the error codes.
2005-09-07 02:34:29.551 Safari[1163] CFLog (99): CFMessagePortCreateLocal(): failed to name Mach port (com.apple.Safari.ServiceProvider)

These errors occur at every Safari startup, what are they? All good apps take parameters so why is Safari any different.Can Safari take parameters ? I tried google but to no avail, also tried Safari.app --help , no luck
http://winlab.csbnet.se Visit the Mac Demo Scene.
     
Mac Elite
Join Date: Oct 1999
Location: San Jose, Ca
Status: Offline
Reply With Quote
Sep 6, 2005, 09:02 PM
 
You are trying this with sudo or when ssh'ed in, arn't you. Safari is a GUI AppKit app, and thus needs a connection to the Window Server. I have no idea what you are thinking, but Safari will take a command line argument, and use it as a file reference. I don't know why you think you should be using Safari from the command line.

If you are trying to script it into doing something, you should be using AppleScript. But that will still not get you past the requirement for a connection to the Window Server.
     
Grizzled Veteran
Join Date: Apr 2002
Location: case.edu
Status: Offline
Reply With Quote
Sep 6, 2005, 09:08 PM
 
It can take a file name to open.

The 'strings' command can be useful for determining such things. There are strings like '--page-load-test' and '--test-commands' in Safari, but they don't seem to do anything when given as options.

Maybe Mr. Hyatt is lurking here?? If you don't think he is, try asking him: http://webkit.opendarwin.org

pb 1440x960 | 1.67, 1.5, 128, 80 | leopard
     
DevNine  (op)
Dedicated MacNNer
Join Date: Mar 2002
Status: Offline
Reply With Quote
Sep 6, 2005, 09:25 PM
 
Originally Posted by larkost
You are trying this with sudo or when ssh'ed in, arn't you. Safari is a GUI AppKit app, and thus needs a connection to the Window Server. I have no idea what you are thinking, but Safari will take a command line argument, and use it as a file reference. I don't know why you think you should be using Safari from the command line.

If you are trying to script it into doing something, you should be using AppleScript. But that will still not get you past the requirement for a connection to the Window Server.
Nope, running this as a regular admin user not root.Safari opens and everything is fine but I'm just wondering what these messages the console outputs are.

Originally Posted by Tesseract
It can take a file name to open.

The 'strings' command can be useful for determining such things. There are strings like '--page-load-test' and '--test-commands' in Safari, but they don't seem to do anything when given as options.

Maybe Mr. Hyatt is lurking here?? If you don't think he is, try asking him: http://webkit.opendarwin.org
Thanks for the strings tip.I did a man strings but can't figure out how to search for strings that are proceeded by -- or -
http://winlab.csbnet.se Visit the Mac Demo Scene.
     
Grizzled Veteran
Join Date: Apr 2002
Location: case.edu
Status: Offline
Reply With Quote
Sep 6, 2005, 10:45 PM
 
Pipe the output of strings into grep. Like so: 'strings Safari | grep ^-'

PS. It is possible to run apps from the command line as root. 'sudo /Applications/System\ Preferences.app/Contents/MacOS/System\ Preferences' and 'sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit' are especially useful.

pb 1440x960 | 1.67, 1.5, 128, 80 | leopard
     
DevNine  (op)
Dedicated MacNNer
Join Date: Mar 2002
Status: Offline
Reply With Quote
Sep 7, 2005, 07:52 AM
 
Originally Posted by Tesseract
Pipe the output of strings into grep. Like so: 'strings Safari | grep ^-'
Excellent, thanks.What does the ^ do ?
PS. It is possible to run apps from the command line as root. 'sudo /Applications/System\ Preferences.app/Contents/MacOS/System\ Preferences' and 'sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit' are especially useful.
Why is it useful to run TextEdit.app as root ?
http://winlab.csbnet.se Visit the Mac Demo Scene.
     
Grizzled Veteran
Join Date: Apr 2002
Location: case.edu
Status: Offline
Reply With Quote
Sep 9, 2005, 05:34 PM
 
The ^ forces the match to be at the beginning of the string. If you were to just do 'grep -', it would find any line with a '-' anywhere in the line. The grep man page explains what special characters you can use when writing a regular expression. If you are going to do much work at the command line, becoming familiar with regular expressions will be most valuable.

(Perhaps obviously) you shouldn't run TextEdit as root for everyday editing. But if you are trying to implement a 'hack' or for some other reason need to edit files as root, and you don't want to use a command-line editor, using TextEdit as root is very effective.

pb 1440x960 | 1.67, 1.5, 128, 80 | leopard
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:52 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2