Launching Safari from terminal window
Hi,
I would like to launch Safari from the terminal window to an HTTP url. When I do that Safari launches with file://http://.
One of the suggestions I've heard is to use open -a, as I am launching other browsers/applications, I would like to keep one consistent way of launching the browser.
Thanks
loganwol.
Pietro_D wrote:
(The application is for the iPhone, I think NSWorkspace isn't part of the SDK...)
You left that part out. I guess you're on your own as I haven't looked at the iPhone SDK at all. Sorry.
Similar Messages
-
How to launch a new terminal window from the current Finder folder?
Hello. I would like to have something like "DOS prompt here" menu item on the Finder popup menu, so that when I click it a new Terminal window is open and set to the respective directory.
Any ideas?I don't know of a way to do that... You might be able to use FruitMenu
http://www.unsanity.com/haxies/fruitmenu
and create a script to launch for the contextual menu that does what you want.
I just open Terminal (by clicking the icon on the Dock), type "cd " and drag the icon of the folder I want to go to to the terminal window (and Return). It's a few steps but not that bad. -
Can't Drag Text from Terminal Window to Mail
I can drag and drop text from Mail to the Terminal window but not the other way around. I can drag text from Terminal to Word but not Mail. Is there a setting I have wrong somewhere?
Do we know if this is in the plasn for 10.5? It just seems like one Apple app to another Apple app should be abel to drag and drop text. It does work from Mail to Terminal... I can always copy and paste the text but it just gnaws away at me I guess.
-
[iPhone] Launch Safari from a link in a UIWebView?
I have a UIWebView with my app's built-in help documentation. I have a few links in these bundled pages that I would like to open in mobile Safari. Obviously, these links just load in my app's UIWebView. If you add target="_blank" to the link, the UIWebView does nothing when the link is clicked. I can't find any url schemes that will launch Safari that wouldn't also be handled by the web view.
So if this is even possible, how can it be done?You'll have to forgive me, but I am a complete newbie to XCode - and I have been playing with the myGoogle example as a starting point to fumbling around the application; but I'm really not sure where your code needs to be added.
I also found another example on dougdiego.com, which extends your concept to keep relative links within WebView, but send anything beginning http/https (and therefore likely to be external) to Safari;
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request
navigationType:(UIWebViewNavigationType)navigationType; {
NSURL *requestURL =\[ \[ request URL ] retain ];
// Check to see what protocol/scheme the requested URL is.
if ( ( \[ \[ requestURL scheme ] isEqualToString: @"http" ]
|| \[ \[ requestURL scheme ] isEqualToString: @"https" ] )
&& ( navigationType == UIWebViewNavigationTypeLinkClicked ) ) {
return !\[ \[ UIApplication sharedApplication ] openURL: \[ requestURL autorelease ] ];
// Auto release
\[ requestURL release ];
// If request url is something other than http or https it will open
// in UIWebView. You could also check for the other following
// protocols: tel, mailto and sms
return YES;
The narrative alongside the above code said "The method shouldStartLoadWithRequest is a delegate method that is called when a link is clicked on. You can override the method and tell it to open in Safari.", which is all very well - but I suspect I need to understand what a delegate method is, and how I override it
Any help would be much appreciated. -
Ct-plugins plug in keeps Safari from displaying window
I had a ct-plugins plug in get on my Mac which caused Safari to not open a window. Tech helped me delete this yesterday. It appeared again today. I did remember how to delete it and did so. But what is the source of this plug in that keeps getting on my Mac?? How do I keep that plug in from getting on here??
Your problem is with the Community Toolbar.
It's a terrible app/plugin that messes up Macs like the plague.
Did you ever install a customized toolbar? Like a Facebook one? Or for watching sports?
Here's how to search and destroy:
Close Safari.
Check here for CT Loader
Locate and delete:
HD/Library/Application Support/Conduit
HD/Library/InputManagers/CTLoader
HD/Library/Receipts/ctloader.pkg
HD/Library/Receipts/<Toolbar name>.pkg
HD/Library/Application Support/SIMBL/Plugins/CT2285220.bundle
HD/Users/<User name>/Library/Application Support/Conduit
It may not be in every single location, but get it out where ever you find it.
Restart Safari. Any Better? -
Stopping Safari from auto-opening all old windows
I find Safari openning all of my windows from when I last shut down incredibly aggrivating. Not only to I not want it but it takes FOREVER to get its barings and even start to load all the pages. I don't understand why Lion has all of these incredibly un-useful features turned on by default with no clear way how to turn them off.
If any one knows how to stop this from happening I'd greatly appriciate it. I've done a search and not really found anything. Thanks!3 or 4 things you can do.
(1) Turn off this "resume" feature for all applications via the checkbox near the bottom of the System Preferences, General pane.
(2) Close all windows by hand before you quit safari.
(3) option-quit safari.
(4) Launch Safari from the dock using shift-click.
charlie -
Opening a new terminal window always launches X11
I did an update from Tiger to Leopard yesterday and while most things are fine, I have a peculiar problem, that every time I open terminal, it automatically launches X11 (the terminal window shows xset as the running application in the title bar). Annoyingly, the focus switches to X11 when it starts, too. I can quit X11, but opening a new window or tab in terminal will launch it again.
Sequence of events:
1. Machine had X11 installed under Tiger.
2. Ran the Leopard update without installing the dev tools package (so as far as I understand, a new X11 wasn't installed during the process). At this point, the problem was present
3. Installed dev tools - problem persists.
4. Ran update to 10.5.2.
5. Got the x11 2.1.4 package from here (http://trac.macosforge.org/projects/xquartz/wiki/X112.1.4) and ran the installer.
But I still have the problem. (In case you're wondering, there's no startup command specified in the Terminal settings, either. It should just start up running bash). Any ideas?jsiehler wrote:
Yes, thanks - sorry I misremembered where the X11 install came from originally. Anyway, what's in my .profile is the command to run fink's /sw/bin/init.sh, which was adding the old X11 directory to my PATH variable. I still don't know why exactly that was making x11 launch every time I opened a terminal window, but I do have it fixed now.
As an aside, you will probably have to uninstall Fink and install the source and build another one. Last I looked there was no binary for Leopard. If you have Tiger version of Xcode Tools, you will also have to remove that, using the supplied script and install the new, Leopard-friendly 3.0.
Also, if you were using Darwin, that too is finito. -
[Solved] Launch GUI application and detach it from terminal
Hello, I find it convenient launching apps from terminal, but after that I am unable to use the terminal, since it it's "attached" to the process. Some searching revealed 2 methods of doing this, but they both don't work for me
1) add "&" after the command: upon closing the terminal the application closes as well; not what I want
2) press ctrl+z: this just closes the app
So how do I type a command to launch a GUI app and continue using the terminal?
I am using mate-terminal.
Last edited by axper (2013-02-11 19:14:08)kaszak696 wrote:https://bbs.archlinux.org/viewtopic.php?id=157405
Thanks a lot, this is exactly what I wanted (for Bash):
olive wrote:
You can disown them (man bash). I have put
PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'disown -a -h'
in my ~/.bashrc with the effect that if you launch a program in the background (with &). It will not be stopped when you close the terminal.
For Zsh, put this in your .zshrc
precmd_disown() {
emulate -L zsh
setopt extendedglob
local job match mbegin mend
jobs | while read job; do
if [[ $job = \[(#b)([[:digit:]]##)\]*running* ]]; then
disown %$match[1]
fi
done
autoload -U add-zsh-hook
add-zsh-hook precmd precmd_disown
(from http://www.zsh.org/mla/users/2010/msg00654.html)
Last edited by axper (2013-06-29 07:47:21) -
I can't open Safari from the bar at the bottom
Can anyone help please. I am not able to open the Safari from the bar at the bottom, I get a message saying that Safari quit unexpectedly & it instructs me to Reopen but when I click on the button the same message appears. I have also been unable to open PDF documents & wonder if this is related to downloading the Lion OS?
Thanks
ReneeI am not able to open the Safari from the bar at the bottom
Hi Renee ..
That "bar" is referred to as the Dock.
Drag the Safari icon straight up off the Dock. It will go "poof" ...
Now try launching Safari from your Applications folder. If you have moved the Safari app from the Applications folder, you need to drag it back.
As for PDF documents, go to ~/Library/Internet PLug-Ins
Move the Adobe PDF Browser plug in to the Trash.
Try Safari.
~ (Tilde) character represents the Home folder.
For Lion: To find the Home folder in OS X Lion, open the Finder, hold the Option key, and choose Go > Library -
Launching Safari also launches Finder
On my wife's MacMini (10.5.6), whenever she launches Safari a finder window launches itself on top of the Safari window. Any idea why? And more importantly, how to make this go away?
Thanks,
RossTry out version 4 and see if the prob repeats itself.
-
Whenever I try to open only Safari, Mail automatically launches. I cannot seem to figure out how to stop it from doing this. I am certain that this is not about programs launching at login. It only began after I did the Safari 6.0 update. I cannot find anything in preferences on how to stop Mail from launching.
Read this whole message before doing anything.
Back up all data if you haven’t already done so. Before proceeding, you must be sure you can restore your system to the state it’s in now.
Quit Safari if it’s running. Then select ▹ Force Quit... from the menu bar. A small window will open with a list of running applications. Safari may appear in that list, even though you quit it. If so, select it and press return. Close the window.
Step 1
In the Finder, press the key combination shift-command-A to open the Applications folder. Select the Safari icon in that folder and press the key combination command-I to open the Info window. There’s a checkbox in the Info window labeled Open in 32-bit mode. Uncheck it, if checked. Close the Info window and the Applications folder.
Hold down the option key and select Go ▹ Library from the Finder menu bar. Delete the following items from the Library folder (some may not exist):
Caches/com.apple.Safari
Caches/com.apple.WebKit.PluginProcess
Caches/Metadata/Safari
Preferences/com.apple.WebKit.PluginHost.plist
Preferences/com.apple.WebKit.PluginProcess.plist
Saved Application State/com.apple.Safari.savedState
Leave the Library folder open. Try Safari again. If it works now, stop here. Close the Library folder.
Step 2
If you still have problems, quit Safari again.
Launch the Terminal application in any of the following ways:
☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
☞ Open LaunchPad. Click Utilities, then Terminal in the page that opens.
Drag or copy — do not type — the following line into the Terminal window, then press return:
rm -fr $TMPDIR../C/com.apple.Safari
Quit Terminal. Launch Safari and test.
Step 3
If Safari still doesn’t work right, quit, go back to the Finder and move the following items from the open Library folder to the Desktop (some may not exist):
Cookies/Cookies.binarycookies
Preferences/com.apple.Safari.LSSharedFileList.plist
Preferences/com.apple.Safari.plist
Preferences/com.apple.Safari.RSS.plist
Preferences/com.apple.WebFoundation.plist
PubSub/Database
Safari
(Note: you are not moving the Safari application. You’re moving a folder named “Safari.”)
Try again. This time Safari should perform normally, but your settings and bookmarks will be lost.
If the issue is still not resolved, quit Safari again and put all the items you moved to the Desktop back where they were, overwriting the newer ones that will have been created in their place. You don’t need to replace the files you deleted in step 1. Stop here and post again.
If Safari is now working normally (apart from the lost settings), look inside the “Safari” folder on the Desktop for a file named “Bookmarks.plist”. Select File ▹ Import Bookmarks from the Safari menu bar. Import from that file. Recreate the rest of your Safari settings. You can then delete the items you moved to the Desktop.
Note: This step will remove your Safari Extensions, if any, and their settings. If you choose to restore them, do so one at a time, testing after each step to make sure you haven’t restored the problem.
If you don’t like the results of step 3, you can undo it completely by quitting Safari and restoring the items you moved or deleted in that step from your backup, overwriting any that were created in their place. -
Stop Safari from launching at start up
Can someone please tell me how to stop Safari from launching automatically when I boot my computer. One day it just started launching on it's own. Very annoying to wait for Safari as it pauses my bootup. If you can help, please email me at [email protected]
Powermac G4 DP 1.25 Mac OS X (10.4)Hi Phil,
To stop Safari to launch automatically >go to the system preferences an select "account" than select ad you right "startup items" deselect Safari an close the window again. The next time you boot your computer Safari wound launch.
Good luck ...
Dimaxum -
Terminal opens when clicking desktop from finder window
I don't know when started to happen, but when I open a window of Finder, and click in the left sidebar to see what is in Desktop, it didn't show in the right panel, it open a Terminal window.
If I click Applications, or Music, it works good, but not with Desktop.
Any ideas? I alredy installed Lion again 3 times, but when restoring from Time Machine, it starts to doing that.
Thank's!Launch the Terminal application in any of the following ways:
☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
☞ In the Finder, press the key combination shift-command-U. The application is in the folder that opens.
☞ If you’re running Mac OS X 10.7 or later, open LaunchPad. Click Utilities, then Terminal in the page that opens.
Drag or copy – do not type – the following line into the Terminal window, then press return:
ls -@Odel ~/Desktop
Post any lines of output that appear below what you entered – the text, please, not a screenshot. If your user name appears in the output, anonymize it for privacy's sake. -
Safari loads multiple windows when launching
When launching Safari, multiple windows load (over 20). I have trashed and reloaded the application from the Apple site and all of my software is up to date. I'm running Lion 10.7.4 and Safari 5.1.7. I have tried "close all windows," "clear history," "empty cache," and "reset Safari," all to no avail.
From the Safari menu bar, select Safari ▹ Preferences… ▹ General ▹ New windows open with: Empty Page.
-
How can i launch application from the terminal in 32-bit mode?
how can i launch application from the terminal in 32-bit mode?
everytime i have to check and uncheck the finder's info panel and it's really annoying, thanks!''Courtesy of cor-el''
https://support.mozilla.com/en-US/questions/823873
Other users should note that Firefox has public release versions of 64bit only for Mac And Linux; not for Windows, yet.
Maybe you are looking for
-
# appearing in standard text.
Hello, I have created a standard text and using the text in a smartform. There are many words with apostrope in them. For eg consumer's. But when it is printed in the smartform , the text is printed as consumer#s. Other standard texts which contains
-
QM & MM : Trigering of Inspection lot creation for Inbound delivery
Hi, Anybody can let me know how I can triger the creation inspection for the Inbound Delivery. With Regards,
-
Adding description text to the screen for a custom infotype.
I have created a custom infotype through PM01 with 3 components. The component types have domains with lists of values (value range). How do I display the short description from the value range on the screen in PA20 or PA30? For example I want to d
-
Hi All, Does any one have any idea abt Sceranio planning in CRM 2007. I need to create scenaio's for a customer plan using 'Agreemeent Deep Copy functionality' of CRM 2007 What is 'Agreement Deep Copy functionality'?..any idea abt this any one?
-
Will Aperture 3 support Canon Rebel T2i Raw picture format? I just got the camera and am disappointed that their software does not yet work with the Lion operating system. They said driver would be available in the first quarter of 2012 but when I