Bento Syncing with Applescript

bento2.png

applescript.jpeg

As I continue my attempts to synchronize using two Macs I have run into a wrinkle. My database application, Bento, does not sync. Since I’m only using one machine at a time, and the address and iCal data is already synced, it works fine if I just copy the database file between computers when switching. The trouble is that Bento insists the database be located in my Application Preferences/Bento folder so it is a pain to drill to it and copy it over to my iDisk. This seemed the perfect excuse to try my Applescript chops. So here is the script:

set SendOrReceive to button returned of (display dialog “Hey Sparky, Sending or Receiving?” buttons {“Sending”, “Recieving”} default button 2 with icon caution)

set LocalBentoFile to POSIX file “Users/david/Library/Application Support/Bento/bento.bentodb”

set iDiskBentoFile to POSIX file “/Volumes/iDisk/Documents/Bento Data/bento.bentodb”

set LocalBentoFolder to POSIX file “Users/david/Library/Application Support/Bento/”

set iDiskBentoFolder to POSIX file “/Volumes/iDisk/Documents/Bento Data/”

tell application “Finder”
if SendOrReceive = “Sending” then
duplicate LocalBentoFile to the folder iDiskBentoFolder with replacing
else
duplicate iDiskBentoFile to the folder LocalBentoFolder with replacing
end if
end tell

This script asks if I’m sending (to iDisk) or receiving (from iDisk) and then copies the file in the right direction. I thought about making it more automatic by comparing dates and duplicating the newest version in both places, but decided I want to have control over what direction the sync is going.

If anyone out there has any ideas for improving it, let me know or leave a comment.

35 Comments Bento Syncing with Applescript

  1. nhepburn@mac.com

    I have a somewhat simpler approach (I think). All I did was copy my Bento folder from ~/Library/Application Support to my iDisk folder. Then I deleted the Bento folder and replaced it with a symbolic link. That way, when I start Bento, it looks in ~/Library/Application Support/Bento and is redirected to the copy on my iDisk. That way, it is always synced between the local computer and iDisk whenever I sync iDisk.

    Reply
  2. nhepburn@mac.com

    I have a somewhat simpler approach (I think). All I did was copy my Bento folder from ~/Library/Application Support to my iDisk folder. Then I deleted the Bento folder and replaced it with a symbolic link. That way, when I start Bento, it looks in ~/Library/Application Support/Bento and is redirected to the copy on my iDisk. That way, it is always synced between the local computer and iDisk whenever I sync iDisk.

    Reply
  3. nhepburn@mac.com

    I have a somewhat simpler approach (I think). All I did was copy my Bento folder from ~/Library/Application Support to my iDisk folder. Then I deleted the Bento folder and replaced it with a symbolic link. That way, when I start Bento, it looks in ~/Library/Application Support/Bento and is redirected to the copy on my iDisk. That way, it is always synced between the local computer and iDisk whenever I sync iDisk.

    Reply
  4. nhepburn@mac.com

    I have a somewhat simpler approach (I think). All I did was copy my Bento folder from ~/Library/Application Support to my iDisk folder. Then I deleted the Bento folder and replaced it with a symbolic link. That way, when I start Bento, it looks in ~/Library/Application Support/Bento and is redirected to the copy on my iDisk. That way, it is always synced between the local computer and iDisk whenever I sync iDisk.

    Reply
  5. nhepburn@mac.com

    I have a somewhat simpler approach (I think). All I did was copy my Bento folder from ~/Library/Application Support to my iDisk folder. Then I deleted the Bento folder and replaced it with a symbolic link. That way, when I start Bento, it looks in ~/Library/Application Support/Bento and is redirected to the copy on my iDisk. That way, it is always synced between the local computer and iDisk whenever I sync iDisk.

    Reply
  6. shoot@beaupix.com

    How about using “unison” command for such purpose? I use Unison to sync a lot of working files and databases among 3 computers I use daily. It figures out which copy is more recent and allows you to override. I use it from a shell script, but it’s just as easy to call from Ruby script or whatever you prefer.

    Reply
  7. shoot@beaupix.com

    How about using “unison” command for such purpose? I use Unison to sync a lot of working files and databases among 3 computers I use daily. It figures out which copy is more recent and allows you to override. I use it from a shell script, but it’s just as easy to call from Ruby script or whatever you prefer.

    Reply
  8. shoot@beaupix.com

    How about using “unison” command for such purpose? I use Unison to sync a lot of working files and databases among 3 computers I use daily. It figures out which copy is more recent and allows you to override. I use it from a shell script, but it’s just as easy to call from Ruby script or whatever you prefer.

    Reply
  9. shoot@beaupix.com

    How about using “unison” command for such purpose? I use Unison to sync a lot of working files and databases among 3 computers I use daily. It figures out which copy is more recent and allows you to override. I use it from a shell script, but it’s just as easy to call from Ruby script or whatever you prefer.

    Reply
  10. shoot@beaupix.com

    How about using “unison” command for such purpose? I use Unison to sync a lot of working files and databases among 3 computers I use daily. It figures out which copy is more recent and allows you to override. I use it from a shell script, but it’s just as easy to call from Ruby script or whatever you prefer.

    Reply
  11. tls258@gmail.com

    Screen sharing is even easier. That is my final answer to sync issues. Keep everything where you most use it, back it up to many places, then share that computer with the others. E.G. I keep everything on my macbook since I carry it around. I have a 28′ Hans-g monitor attached for RE. Then, upstairs, I have a 17″ powerbook with a 30″ Dell monitor attached for RE. Using screen sharing, the 30″ shows the 28″ as a full screen. What I have found is that trying to sync my iDisk between computers always results in file loss and extra work. Much easier to keep everything in one place. You can remote screen share also.

    Reply
  12. tls258@gmail.com

    Screen sharing is even easier. That is my final answer to sync issues. Keep everything where you most use it, back it up to many places, then share that computer with the others. E.G. I keep everything on my macbook since I carry it around. I have a 28′ Hans-g monitor attached for RE. Then, upstairs, I have a 17″ powerbook with a 30″ Dell monitor attached for RE. Using screen sharing, the 30″ shows the 28″ as a full screen. What I have found is that trying to sync my iDisk between computers always results in file loss and extra work. Much easier to keep everything in one place. You can remote screen share also.

    Reply
  13. tls258@gmail.com

    Screen sharing is even easier. That is my final answer to sync issues. Keep everything where you most use it, back it up to many places, then share that computer with the others. E.G. I keep everything on my macbook since I carry it around. I have a 28′ Hans-g monitor attached for RE. Then, upstairs, I have a 17″ powerbook with a 30″ Dell monitor attached for RE. Using screen sharing, the 30″ shows the 28″ as a full screen. What I have found is that trying to sync my iDisk between computers always results in file loss and extra work. Much easier to keep everything in one place. You can remote screen share also.

    Reply
  14. tls258@gmail.com

    Screen sharing is even easier. That is my final answer to sync issues. Keep everything where you most use it, back it up to many places, then share that computer with the others. E.G. I keep everything on my macbook since I carry it around. I have a 28′ Hans-g monitor attached for RE. Then, upstairs, I have a 17″ powerbook with a 30″ Dell monitor attached for RE. Using screen sharing, the 30″ shows the 28″ as a full screen. What I have found is that trying to sync my iDisk between computers always results in file loss and extra work. Much easier to keep everything in one place. You can remote screen share also.

    Reply
  15. tls258@gmail.com

    Screen sharing is even easier. That is my final answer to sync issues. Keep everything where you most use it, back it up to many places, then share that computer with the others. E.G. I keep everything on my macbook since I carry it around. I have a 28′ Hans-g monitor attached for RE. Then, upstairs, I have a 17″ powerbook with a 30″ Dell monitor attached for RE. Using screen sharing, the 30″ shows the 28″ as a full screen. What I have found is that trying to sync my iDisk between computers always results in file loss and extra work. Much easier to keep everything in one place. You can remote screen share also.

    Reply
  16. idou747@gmail.com

    Just like iTunes, iWeb etc, you can hold down Option key when starting Bento and then choose your database location from iDisk.

    Reply
  17. idou747@gmail.com

    Just like iTunes, iWeb etc, you can hold down Option key when starting Bento and then choose your database location from iDisk.

    Reply
  18. idou747@gmail.com

    Just like iTunes, iWeb etc, you can hold down Option key when starting Bento and then choose your database location from iDisk.

    Reply
  19. idou747@gmail.com

    Just like iTunes, iWeb etc, you can hold down Option key when starting Bento and then choose your database location from iDisk.

    Reply
  20. idou747@gmail.com

    Just like iTunes, iWeb etc, you can hold down Option key when starting Bento and then choose your database location from iDisk.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *