New topic: 

Problems getting a value back from applescript (variable)

<http://forums.realsoftware.com/viewtopic.php?t=45836>

         Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic          Author  
Message        markconaty          Post subject: Problems getting a value back 
from applescript (variable)Posted: Wed Nov 07, 2012 2:40 pm                     
    
Joined: Wed Nov 07, 2012 11:59 am
Posts: 1                Can anyone help me and tell me why the first code works 
(it's hardcoded) and the second one does not... the value is reaching the 
applescript as far as I know...

--------------------------------------------------------------------
  dim z as Variant
z = "12000"

dim lines(-1) as string

lines.Append "set z to ""12000"""

lines.Append "tell application ""FileMaker Pro"""
lines.Append "  tell database ""DESIGN DATABASE"""
lines.Append "    set b to field ""JobNumber"""
lines.Append "  end tell"
lines.Append "  end tell"
lines.Append "return b contains z"


dim source as string = Join(lines,EndOfLine)
dim n as new NSAppleScriptMBS(source)

dim error as Dictionary
dim d as NSAppleEventDescriptorMBS = n.execute(Error)

MsgBox str(d.BooleanValue)


--------------------------------------------------------------------

 dim z as Variant
z = "12000"

dim lines(-1) as string

lines.Append "on run {z}"
lines.Append "tell application ""FileMaker Pro"""
lines.Append "  tell database ""DESIGN DATABASE"""
lines.Append "    set b to field ""JobNumber"""
lines.Append "  end tell"
lines.Append "  end tell"
lines.Append "return b contains z"
lines.Append "end run"

dim source as string = Join(lines,EndOfLine)
dim n as new NSAppleScriptMBS(source)

dim error as Dictionary
dim d as NSAppleEventDescriptorMBS = n.execute(Error)

MsgBox str(d.BooleanValue)

--------------------------------------------------------------------

I am getting an error on the line:

  MsgBox str(d.BooleanValue)
  

Any help would be greatly appreciated

Thanks

Mark   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to