I keep moving between using standard files & folders in the Finder, and using DevonThink. In my most recent move I moved from DT to F&F and was able to quickly set up some automation using Python (my preferred programming language). The move to F&F was largely motivated by that it simply was easier for me to set up some automation using Python since I have forgotten most of what I knew about AppleScript (I used to be pretty good at it).
Now I want to see if I can do the same thing inside DT using AppleScript, but I don’t know the best approach for how to do it. There are two scripts that I want to see if I can replicate, the first in pretty simple and shouldn’t be much of a problem. It’s basically asks for some info and then create a set of files and folders in a predefined place - the only problem should be the clumsiness of AppleScript when it comes to text handling. The second I don’t know the best way to implement.
What happens is that the first script, among the other files, creates one file that contains some basic data. Then I spend some time to find additional data that I manually fill in. In the second script I want to take the data from that file and create some additional files.
Here is how I want it to work with some imagined data: I run the first script which asks for some names - let’s say “Anna, Bertil, Cecilia” - and creates a file like this (Note: this is just an example format, this looks different in my Python solution)
first: Anna
last:
email:
phone:
first: Bertil
last:
email:
phone:
first: Cecilia
last:
email:
phone:
I figure out what the missing data is and get something like this
first: Anna
last: Andersson
email: aa@example.com
phone: 123456
first: Bertil
last: Bo
email: bb@example.com
phone: 234561
first: Cecilia
last: Carlsson
email: cc@example.com
phone: 345612
I now want the second script to parse this data and create some additional files. But I don’t know the best way to store & retrieve data using AppleScript. In my Python solution I simple use the config module and store this data as a config file, i.e. a text file in a well defined format.
How would you solve this using AppleScript and DT (I would prefer a solution that uses text files but I’m open for other suggestions)