Excel through learning

Excel through learning
Your source of knowledge

Saturday, August 23, 2008

SKSchema Script: Sync PDA with laptop via bluetooth

One of the most common thing that PDA user do is to sync it with the laptop so that the meeting, contacts, email and some other stuff are always up to date. However, I feel the process is very irritating, even though what i need to do is just to connect the PDA to the laptop using a USB cable. My laptop has the bluetooth and I always leave it on all the time (with the wifi). Hence, I wrote a script to perform the sync via automatically twice a day:


  1. At the scheduled time, turn on the PDA's ActiveSync and start to sync via bluetooth. This will happen when my pda is in suspend mode.
  2. Turn off the screen and wait until the sync finish.
  3. Turn off the bluetooth, quite the ActiveSync and suspend the PDA.

I use the MobSync to backup and sync the extra folders when there is a connection between the PDA and laptop. So, my script have to know when the MobSync has finish the process. In order to let my script to be smart, I use a simple script. The last process of the MobSync is to copy a dummy file from laptop to PDA. So, the script will keep looking for the dummy file. If the dummy file still not copied to PDA, it means that the sync still in process. If it found the file, means that the sync is finish. So, the script can finish the sync process. The script will also remove the dummy file, so that it wont be confused for the next sync process. Below is the code for the bluetooth sync. You can copy and modify, then save to a file like bluetoothsync.sksc. Then just use the SKSchema to schedule when to run this file.

#r(#yesno) #p(Sync pc? ) #rmt(5000)
#r(#iffalse) #p(end)
#r(#ifunknown) #p(end)
#r(\windows\repllog.exe) #p(/remote)
#r(#tap) #p(199;308) #sleep(700)
#r(#tap) #p(199;284) #sleep(700)
#r(#0) #sleep(30000)
#r(#delete) #p(\Storage Card\02.JUNK\dummy.txt)
#r(#playwav) #p(\My Documents\h_start.wav)
#r(#eval) #p(b=0)
#r(#findwindow) #p(Bluetooth ActiveSync)
#r(#iffalse) #p(continue)
#r(#activatewindow)
#r(#tap) #p(162;202) #sleep(700)
#r(#goto) #p(done2)
#r(#label) #p(continue)
#r(#yesno) #p(off screen?) #rmt(5000)
#r(#iffalse) #p(syncwait)
#r(#eval) #p(b=1)
#r(#scr)
#r(#label) #p(syncwait)
#r(#chkasconnection)
#r(#iffalse) #p(done)
#r(#ifunknown) #p(done)
#r(#0) #sleep(4000)
#r(#yesno) #p(stop sync? ) #rmr(1) #rmt(3000)
#r(#iftrue) #p(done)
#r(#0) #sleep(4000)
#r(#chkfile) #p(\Storage Card\02.JUNK\dummy.txt)
#r(#iftrue) #p(removefile)
#r(#chkcondition) #p(b==1)
#r(#iffalse) #p(syncwait)
#r(#playwav) #p(\My Documents\attn.wav)
#r(#goto) #p(syncwait) #sleep(2000)
#r(#label) #p(removefile)
#r(#delete) #p(\Storage Card\02.JUNK\dummy.txt)
#r(#label) #p(done)
#r(#scn)
#r(#findwindow) #p(ActiveSync)
#r(#iffalse) #p(btoff)
#r(#activatewindow) #p(ActiveSync)
#r(#tap) #p(199;308) #sleep(700)
#r(#tap) #p(199;284) #sleep(350)
#r(#0) #sleep(4000)
#r(#label) #p(done2)
#r(#findwindow) #p(ActiveSync)
#r(#activatewindow)
#r(#tap) #p(229;14) #sleep(700)
#r(#label) #p(btoff)
#r(#playwav) #p(\My Documents\h_finish.wav)
#r(#btoff) #sleep(1000)
#r(#yesno) #p(suspend? ) #sleep(1000) #rmt(5000)
#r(#iffalse) #p(end)
#r(#ifunknown) #p(end)
#r(\program files\pocketplus\actionsender.exe) #p(-key PLUSACTION{000600000000} Suspend)
#r(#label) #p(end)

0 comments: