Script for Moving Data to Another Database?

I was looking for information on how to best move data from one database to another, and it seems to involve multiple steps: (1) export from one database, (2) import to another database, (3) go back to original database and delete moved data, (4) go into the Finder and delete the export folder. (Basically, right?). So I was wondering if someone with more Applescript kung-fu than me could write an Applescript that would do this all in one shot: Take the selected data, export it, open the other database, import it to there, and then delete the data from the original database and the Finder (although perhaps deletion from the original database could happen right after export). It seems possible, and I could probably figure it out after a lot of trial and error, but hopefully someone can just bang this out. Any takers?


I would caution that even if it’s possible to run through that entire sequence with a script involving switching databases, it would be very wise to work with copies of your databases until thoroughly satisfied the script works as intended.

Error-checking in AppleScript is a fine art and isn’t all that powerful.

As my main database is also my default database, I use it to add new content that’s really intended for other databases. I organize that ‘extraneous’ material into groups that are destined to be exported to corresponding folders in the Finder.

When the time comes to export and purge that material, each group is exported to the corresponding folder in the Finder, the contents of each such group are purged from my main database, and then I switch to other databases and each imports the contents of its corresponding Finder folder. Then I purge the contents of the Finder folders, ready for the next round of data movement when I get around to that again.

With planning and organization, this only takes a few minutes.