Applescript/RB Question. 
Author Message
 Applescript/RB Question.

I want to make an application in RB that runs applescript in its code.
Unfortunatly I have never done this, and I am stumped as to where to
start.  I also want it to have the ability to hand variable values to
the applescript.

For example:

And application that has a textbox and a pushbutton, how could I make an
application that takes the text from the text box and on clicking the
button creates a folder named after whatever is in the textbox?

I am fairly sure this problem is simple, it just eludes me.  All
reponses are welcome.

Thanks in advance.

-Damien



Mon, 24 Nov 2003 08:33:27 GMT  
 Applescript/RB Question.

Quote:

> I want to make an application in RB that runs applescript in its code.
> Unfortunatly I have never done this, and I am stumped as to where to
> start.  I also want it to have the ability to hand variable values to
> the applescript.

> For example:

> And application that has a textbox and a pushbutton, how could I make an
> application that takes the text from the text box and on clicking the
> button creates a folder named after whatever is in the textbox?

> I am fairly sure this problem is simple, it just eludes me.  All
> reponses are welcome.

On the one hand, you don't need AppleScript to do this. Just use
GetFolderItem to make a foldItem that describes the folder you want, and
then use folderItem.CreateAsFolder. Like, maybe:

dim f as FolderItem
f = GetFolderItem(EditField1.Text)
if f <> nil then
  f.CreateAsFolder
end if

On the other hand, in terms of using an AppleScript from your RB
program, that's covered in the REALbasic Developer's Guide. Essentially,
you drag your compiled script, which has a Run handler, to the Project
window, and then you access it as if it were any other method.

HTH.

--
"In a world full of lies / That tug at the truth
 I'm taking no sides / Now I recognize you." -DS



Mon, 24 Nov 2003 10:02:17 GMT  
 Applescript/RB Question.

hmm, yes, that was a very bad example. =P

But I want to be able to throw variables at the script, like an
applescript that lets say just types something, how could I make it so
what it types is user defined from something like a textbox?

Thanks for the prompt reply BTW =)

you rock



Mon, 24 Nov 2003 10:25:47 GMT  
 Applescript/RB Question.

Quote:

> hmm, yes, that was a very bad example. =P

> But I want to be able to throw variables at the script, like an
> applescript that lets say just types something, how could I make it so
> what it types is user defined from something like a textbox?

Like I said, it's all in the RB Developer's Guide. :-)

HTH.

--
"In a world full of lies / That tug at the truth
 I'm taking no sides / Now I recognize you." -DS



Mon, 24 Nov 2003 11:36:25 GMT  
 Applescript/RB Question.
Ok, I will RTFM.

=P  sorry.



Mon, 24 Nov 2003 22:45:56 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. RB and AppleScript question again.

2. Question about RB and AppleScript

3. Hot to run AppleScript within my RB prog?

4. Start running an uncompiled AppleScript by RB app

5. calling applescript from RB again

6. RB and AppleScript

7. Applescript/RB help

8. install.rb/setup.rb question

9. RB QuickStart Guider from RB

10. launching an RB app from another RB app - appleevents

11. RB Entwickler gesucht / RB Developers wanted

12. RB: row order by RB database

 

 
Powered by phpBB® Forum Software