I don't quite have this working the way I want it to yet, but it's close enough that I'm using it and probably won't work on it for a while. It has some room for improvement. For instance, my phone won't feed a file list to the computer through OBEX for some reason so I didn't include any way to browse the phone files. You just have to know the filename of any files you want to pull from the phone. It uses the obexftp utility because I didn't particularly feel like coding the actual file transfer from scratch, particularly since I'd have had to find and learn to use an obex library to do it.

#!/usr/bin/perl # #This script is intended to use obex to transfer files to and from my #cell phone, a Samsung MyShot (yes, I know it has a more accurate mode +l #number, but I'm writing this thing after having given up on sleep for + the night) use strict; use warnings; use Tk; use vars qw($file $mw $phoneAddr); #Set the bluetooth address of the phone $phoneAddr="Phone BT Address"; $mw=new MainWindow(-title=>"FoneFiles"); $file=$mw->Entry(); my $fileButton=$mw->Button(-text=>"Get File to Push",-command=>\&getFi +le); my $getPutFrame=$mw->Frame(); my $getButton=$getPutFrame->Button(-text=>"Get",-command=>\&getGo); my $putButton=$getPutFrame->Button(-text=>"Put",-command=>\&putGo); #Main window geometry $file->pack(); $fileButton->pack(); $getPutFrame->pack(); $getButton->pack(-side=>"left"); $putButton->pack(-side=>"left"); #sub to pick file to push to phone. I didn't write one to pick a file +to get #from the phone because it would work with my phone even if I did. sub getFile { my $filename=$mw->getOpenFile(); $file->configure(-text=>$filename); } #sub to get file from phone sub getGo { my $varFile=$file->get(); $varFile=~s/\ /\\ /; my $notice=$mw->Toplevel(-title=>"Getting"); my $lab=$notice->Label(-text=>"Getting file from your phone. Pleas +e wait")->pack; $mw->update; $notice->update; #obexftp is a command line obex utility. #This line will use the obex push protocol to get a file from +the phone `obexftp -b $phoneAddr --nopath --get $varFile`; destroy $notice; } #sub to send a file to the phone sub putGo { my $varFile=$file->get(); $varFile=~s/\ /\\ /; my $notice=$mw->Toplevel(-title=>"pushing"); my $lab=$notice->Label(-text=>"Pushing file to your phone. Please +wait")->pack; $mw->update; $notice->update; #This command uses obex push to push a file to the phone `obexftp -b $phoneAddr --nopath --put $varFile`; destroy $notice; } MainLoop;

In reply to Phone file transfer utility by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.