Welcome to MacTalk Australia

the largest Australian community for Apple discussions and topics

Join the discussions, Register Now!
Results 1 to 7 of 7
  1. #1

    Join Date
    Jan 2004
    Location
    Adelaide
    Posts
    6,201

    Thumbs up

    Hey,

    I found this hint on macosxhints:
    http://www.macosxhints.com/article.php?sto...030514035516436

    This hint describes a way of changing Safari's default search engine. Unlike the method which was posted a couple of days ago, this method does not block normal access to google.com. This hint assumes you are familiar with the vi text editor. First, quit Safari and make a backup copy of the application. Then follow these steps:
    Launch Terminal, and use the vi editor to open the Safari executable file. The command will probably look like this for most users:
    % vi /Applications/Safari.app/Contents/MacOS/Safari


    Search for the text google. The first occurrence will be a string that looks like this:
    http://%@.google.com/%@?q=%@&ie=UTF-8&oe=UTF-8

    This is the string that needs to be modified.


    Change the string to the search engine you'd like to use. When changing this string, two things need to be kept in mind. First, the length of the new string must be the exact same length as the original. Second, you need to have two %@ sequences in the string. The second %@ should represent where your "query" would go in the URL. Here is an example. To make Yahoo! the default search engine, replace the string:
    http://%@.google.com/%@?q=%@&ie=UTF-8&oe=UTF-8

    with:
    http://%@@search.yahoo.com/bin/search?p=%@&a=0

    The way I figured this out was by performing a search at yahoo.com for "apple". The URL of the results page was:
    <a href=\'http://search.yahoo.com/bin/search?p=apple\' target=\'_blank\'>http://search.yahoo.com/bin/search?p=apple</a>

    So to keep my length constant, I needed to expand the string a little. I added a %@@ at the beginning of the URL. Putting "something@" at the beginning of a URL will not affect the loading of a site. This allowed me to take care of the first %@ sequence I needed to retain. Then I replaced apple with another %@. This is obviously where my &#39;query&#39; fits into the URL. Finally, I needed to add a bogus (unused) form field to the URL, so that the string would be the correct length. I added &a=0. So if you take a look at the original string, and the new one, the lengths of both strings are identical, as seen above.


    Save your changes and quit the editor.
    The next time you use Safari&#39;s search box, your favorite search engine will be used. Note that if the string you enter is not of the correct length, Safari will fail to launch.


    Now, i&#39;m having trouble getting Alta vista&#39;s search to work there. Everyone on that page lists scripts for yahoo search, alltheweb search, dictionary.com search, etc... but i&#39;d like to use altavista.


    The search string for altavista needs to be the same length as the google one in the safari file.

    eg:
    http://www.altavista.com/web/results?q=App...=mozilla-search (taken from firefox)
    http://%@.google.com/%@?q=%@&ie=UTF-8&oe=UTF-8 (taken from safari)



    Can anyone offer any help?

    edit: and you don&#39;t need to use the terminal, you can just "Show package contents" of safari and browse to contents/macos/safari through there and edit the file in text edit.
    Read my drivel, be dazzled by my Twitter

    Are you some kind of devil trying to keep me from using my time usefully? - Currawong
    "You're an enigma wrapped in a ferreo roche" - fulltimecasual

  2. #2

  3. #3

    Join Date
    Jan 2004
    Location
    Adelaide
    Posts
    6,201

    Default

    Excellent. *mr burns*

    That worked a treat.
    Read my drivel, be dazzled by my Twitter

    Are you some kind of devil trying to keep me from using my time usefully? - Currawong
    "You're an enigma wrapped in a ferreo roche" - fulltimecasual

  4. #4

    Default

    I find that Huevos http://www.versiontracker.com/dyn/moreinfo/macosx/14301 handles all my searching needs quite well

    jameso

  5. #5

    Join Date
    Apr 2004
    Location
    Perth
    Posts
    3,102

    Default

    It's been nearly 4 years since this thread was posted.

    Has someone not developed an easier way to change the deafult search engine in Safari yet, without resorting to the command line or other software?
    .
    Times are bad. Children no longer obey their parents, and everyone is writing a book.

    - Cicero (106BC-43BC)

  6. #6

    Join Date
    Apr 2005
    Location
    is where i is at
    Posts
    965

    Default

    yes they have its called Inquisitor

    http://www.inquisitorx.com/safari/
    righto then

  7. #7

    Join Date
    Apr 2004
    Location
    Perth
    Posts
    3,102

    Default

    David Watanabe again? No thanks.

    Edit: does the original hint above still work? I get as far as the first step and I just get gibberish in the terminal window, like this -

    .
    Times are bad. Children no longer obey their parents, and everyone is writing a book.

    - Cicero (106BC-43BC)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •