set parameter values of networkCue to "/some/osc/message " & param1 & space & param2 & space & param3
-- find data in spreadsheet and use values in parameters to network cue
-- need to add error check for production use
tell application id "com.figure53.QLab.5" to tell front workspace
-- get the value to look for from user
set defaultNum to 5
set myValue to text returned of (display dialog "value to look for " default answer defaultNum with title "Get data from spreadshet")
-- get the row from spreadsheet based on matching data in specified column with value
-- must compare same type of values; so convert string to integer using div 1 [note 'as integer' actually rounds]
set myValue to myValue div 1
set mycol to 1
set myRowData to my findDataInSheet(mycol, myValue)
if myRowData is false then
display dialog "not found"
return
end if
-- for debugging display the values returned from spreadsheet row
--display dialog (myRowData as text) with title "Debug spreadsheet row returned"
-- adjust the column numbers here as necessary
set {param1, param2, param3} to items 2 thru 4 of myRowData
-- make a Network cue and set the parameters of the OSC message from spreadsheet data
make type "Network"
set netCue to last item of (selected as list)
-- set the parameter values of network cue using data from spreasheet
set parameter values of netCue to "/some/osc/message " & param1 & space & param2 & space & param3
-- set the other parameters of the Network cue here
end tell
on findDataInSheet(colNum, myValue)
-- find the value in the first column and return the row
-- assumes the spreadsheet is alreaady open in Numbers
tell application "Numbers" to tell active sheet of front document to tell first table
repeat with rown from 2 to row count
set rowarray to (value of cells 1 thru 4 of row (rown)) as list
if item colNum of rowarray is myValue then
return rowarray
end if
end repeat
end tell
return false
end findDataInSheet