Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

A script to send MapQuest directions via Bluetooth UNIX
This script sends MapQuest directions to a BlueTooth-enabled Nokia phone. This script has been tested with a Nokia 3620 model. Copy the following script into a text editor, and save as mapquest.pl.
#!/usr/bin/perl

print "Enter filename for parsing:";

my $filename = <STDIN>;
my $outfile = "writeout";
open MYHANDLE, "<$filename";
open WRITEFILE, ">$outfile";
$i =1;
while(<MYHANDLE>)
{
     chomp($name = $_);
     print WRITEFILE "$name";
     if($i %5==0)
     {
	 print WRITEFILE "\n";
     }
      $i++;
}
close MYHANDLE;
close WRITEFILE;
system "cp $outfile $filename"; 
system "open -a /Applications/Utilities/Bluetooth\\ File\\ Exchange.app/ $filename";
exit(0);
In the Terminal, type the following to make the script executeable:
chmod 755 mapquest.pl
Now go to MapQuest's directions page and enter driving directions. Click on the Print link. Highlight only the directions (start highlighting at number 1 until you get to the last step in the directions) -- do not highlight map! Copy and paste into a text editor, and then save it to your hard drive.

Finally, run the script you created above (mapquest.pl). The script will ask for the directions file, and then send the file to the Bluetooth-enabled phone.

[robg adds: I haven't tested this one; I usually just use the "Send File to Bluetooth Device" system service from the Finder, but this script could save a step or two...]
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[9,442 views]  

A script to send MapQuest directions via Bluetooth | 7 comments | Create New Account
Click here to return to the 'A script to send MapQuest directions via Bluetooth' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A script to send MapQuest directions via Bluetooth
Authored by: tofergregg on Aug 05, '04 07:56:59PM

I find that the formatting seems a bit better if, instead of going to the Print page, I go to the "Download to PDA" page and do the copy/paste from the directions that are already formatted on the left. Cheers.



[ Reply to This | # ]
A script to send MapQuest directions via Bluetooth
Authored by: lmentop on Aug 05, '04 08:22:15PM

how do i get this .pl file to not open with adobe golive? what should i tell it to open with?



[ Reply to This | # ]
A script to send MapQuest directions via Bluetooth
Authored by: elppamac on Aug 09, '04 04:33:02PM

You don't have to name the file .pl if it is causing a problem. The .pl is just to denote that it is a perl script. You can just name the file mapquest and open it with Text edit.



[ Reply to This | # ]
A script to send MapQuest directions via Bluetooth
Authored by: jasont on Aug 05, '04 08:27:38PM

Under services I also have 'send to bluetooth device' I believe this is BlueService 1.2.2 or earlier. I just highlight the text, select it from the services, up pops the bluetooth selector I select my 6600 (since i'm using 10.2.8 I click ok if it says the device won't accept) and using OBEX push the file shows up in my inbox as a message, which opens in notes. This seems to save quite a few steps, still the formatting tip on using the pda part seems relevant.



[ Reply to This | # ]
A script to send MapQuest directions via Bluetooth
Authored by: ibroughton on Aug 08, '04 10:56:29AM

I can't send any highlighted text to my phone in this way, is there something I am missing here? I've got the services required on the phone (HF Voice Gateway, Dial-up Networking, OBEX SyncML Client, HS Voice Gateway, Serial Port, Serial Port 2, OBEX Object Push, OBEX IrMC Sync Server, Mouse & Keyboard, OBEX Basic Imaging, OBEX File Transfer) and everything else works fine when I manually send a file via the Bluetooth File Exchange Utility.

---
The server is up but the site is down and I don't know which direction you are trying to go



[ Reply to This | # ]
A script to send MapQuest directions via Bluetooth
Authored by: e1en0r on Aug 05, '04 10:54:26PM
It seems like combining this script with a slightly modified version of this script (which saves highlighted safari text to your hard drive) would be really handy.

[ Reply to This | # ]
too many steps
Authored by: shneusk on Aug 12, '04 10:10:50AM

copy paste save open? wouldn't it be easier to hit the "email directions" link and email it to your phone? that's what I do with my Sony Clie



[ Reply to This | # ]