Applescript - how do I use the result of a library return value
Hello. Been using applescript for about a week. Very new.
I'm using the following script below using an external libarary to query mysql database on external server. works. gives results. How do I save them to do something with the.
when I run it, the results of the call to the library show up in the results window. that makes sense.
ie
{rows:1, cols:1, record_data:{{"85016 "}}}
I want to assign the results to a variable to use it later, particularly the 85016.
I try "set testVariable to tell db_link to do_select(theDBCommand)"
no good. Not sure how to do this.
Help appreciated.
Script follows:
-- links to the mysql tools - thanks to http://www.j-schell.de/node/80
set library_path to "js_aux_scripts:mysql_objects.scptd"
set app_support to (path toapplication support folder) as string
set DB_Library to (load scriptfile (app_support & library_path))
set db_link to new_link("lala.yadayada.com", "user", "pass", "db") of DB_Library
-- collect the job number you want to run
-- Get the Number
set displayString to "Enter Job Number"
set the theIcon to 1
set theJobNumber to ""
repeat
display dialogdisplayStringdefault answertheJobNumberwith icontheIcon
set theJobNumber to text returned of result
try
if theJobNumber = "" then error
set theJobNumber to theJobNumber as number
exit repeat
on error
set displayString to "INVALID ENTRY! " & displayString
set theIcon to 0
end try
end repeat
-- Query the database and get the other informtion from the ticket file.
set theDBCommand to "SELECT BaseId from SfComp where JobNo = " & theJobNumber
tell db_link to do_select(theDBCommand)
applescript-OTHER, Mac OS X (10.7.3)