AppleScript connector for Salesforce.com

The AppleScript connector allows you to make calls to the Salesforce.com Web Services API from applescript, enabling you to highly customize and integrate your desktop OSX environment with Salesforce.com.

Getting going

Download the application (Requires OSX 10.5 or later), and drop it in your applications folder. The name of the application is called SalesforceScripting, so every script would start with
tell application "SalesforceScripting"

Starting a new User Session.
	set mySession to login username "someusername@sample.com" password "mypassword(and possibly security token)"
Create a new Account in Salesforce (note that like the web api, create can take multiple objects, and returns a list of SaveResult objects)
	set acc to make SObject
	set type of acc to "Account"
	acc setField named "Name" to "My New Account"
	set res to mySession create sobjects acc
	Id of first item of res
Check for errors when creating/updating records
	set cont to make SObject
	set type of cont to "Contact"
	cont setField named "LastName" to "blowy"
	set resList to session create sobjects cont 
	set res to first item of resList
	if success of res then
		display dialog "created contact, Id is " & Id of res
	else
		display dialog "couldn't create contact " & StatusCode of res & ":" & message of res
	end if
Querying Salesforce.com
	set res to query mySession soql "select id, name, annualrevenue, createdDate, createdBy.Name from account order by createdDate desc"
	set L to (get every SObject of res)
	repeat with row in L
		Id of row -- the Salesforce.com record Id
		type of row -- the SObject type, e.g. Account
		row value of "Name"	-- get the Name field
		row value of "CreatedBy.Name" -- shortcut to get the Name field of the CreatedBy related user object
		row dateValue of "CreatedDate" -- the date/time value of the CreatedDate field
		row numberValue of "AnnualRevenue" -- the number from the annual revenue field
	end repeat
See the users properties from UserInfo
		tell application "SalesforceScripting"
			set session to login with saved credentials
			set u to users info of session
			serverUrl of session
			sessionId of session
			username of u
			userId of u
			profileId of u
		end tell
Show the user an interactive login dialog
	tell application "SalesforceScripting"
		set session to show login window
		-- do something with session
	end tell
Examine the results of a describeGlobal call
	tell application "SalesforceScripting"
		set session to login with saved credentials
		name of every SObjectDescribe in session whose custom is false
	end tell
Look at field Describes
	tell application "SalesforceScripting"
		set session to login with saved credentials
		set d to first SObjectDescribe in session whose name is equal to "Account"
		set f to first FieldDescribe in d whose name is equal to "OwnerId"
		label of f 
	end tell
API Call log window

Still things to do, including

Release History

SalesforceScripting is open source, see the Github project.

v0.6 July 16, 2010M

v0.5 June 4, 2010

v0.4 June 3, 2010

v0.3 June 2, 2010

v0.2 June 2, 2010

v0.1 June 1, 2010