Outlook scripting help

I’ve just started with apple scripting so I am not very noledgealbe about it yet but I am learning. what i am trying to to is open a web based address book we have here at my work that is tab delemited in a form that outlook express can import, I am trying to create a script that can copy the information from internet explorer paste it into a document in simple text or some other way, and import it the address book in outlook express. so far i have a script that opens ie and goes to the site copies the page creates a file opens it in simpletext and pastes it in there then closes simpletext after this point I am at a hault trying to find a way to get outlook to import through scripting. The whole perpose of this is for employees to just click the script and wallaa the contacts are there in there address book. Any help with this is appriciated.

I know how to set up display names and email addresses in the contact records so the following script will do that. I don’t know where your web based document resides - if it is on a network you can bypass IE by just reading the document, otherwise just do what you are doing with IE.

You don’t have to use SimpleText to write the data to a text file. I included info on how to do that too.

Hope this helps,

Well, I looked a little deepeer and found that you can access any field in the contact record. In my other post we made a new contact by saying:

make new contact with properties {display name:dispName, address:emailAddress} 

You should be able to use any of the properties below in the above statement: (Found in the OE Dictionary)

so if you wanted to also add the comany name it might be:

make new contact with properties {display name:"Ken Lay", address:KenLay@Enron.com, company:"Enron"} 

ok here is what I have know but I am still having trouble getting anything Tell me if I have the right idea, Oh I ment to say that the file is comma delimited not tab sorry I think I have it set right now. thanks


(*if the web based, tab delimited address book is on a network, and not on the internet you can just point the script to the file 
by enabling the line below. Otherwise just use the method you are via IE*)
--set addressFileTxt to read "Mac HD:Desktop Folder:address.txt" as text --we'll use this for writing the file later 
set addressFile to read "Powerbook G3:Desktop Folder:address.txt" as text using delimiter return --we'll use this list for parsing and making contacts 

repeat with thisAddress in addressFile
	set oldDelims to AppleScript's text item delimiters --capture these so you can set them back 
	set AppleScript's text item delimiters to ","
	set addressPropList to the text items of thisAddress --split this item up at the tabs 
	set AppleScript's text item delimiters to oldDelims --set the TID's back to the default 
	set dispTitle to item 1 of addressPropList
	set dispFirstName to item 2 of addressPropList
	set dispLastName to item 3 of addressPropList
	set dispDepartment to item 4 of addressPropList
	set dispemailAddress to item 5 of addressPropList
	tell application "Outlook Express"
		set thisEntry to make new contact with properties {title:dispTitle, first name:dispFirstName, last name:dispLastName, department:dispDepartment, address:dispemailAddress} --make the entry 
	end tell
end repeat

Works for me. Did you get it to work?

Yeah The file I am using has a space at the top I can’t figure out how to make the script get rid of One i removed it it worked great thanks for you r help, I do want to know if there is a way I can have it check so if its run again with an updated address book so it won’t import dulplcates?? Am i explaining it clearly. Also The file i am getting the address book from is being produced from a cgi script on the network from a database of names emails exetra. Is there a better way than I am doing to make the address.txt file than opening ie to the page copying and pasting then opening simple text and pasting it?