starting another program from within realbasic 
Author Message
 starting another program from within realbasic

hi all,

how can i get an realbasic application to start up a separate
application located in a folder?  i can do it with an applescript but
there has got to be another way.

thanks in advance,
ralph



Thu, 03 Jul 2003 13:38:42 GMT  
 starting another program from within realbasic

Quote:

> how can i get an realbasic application to start up a separate
> application located in a folder?  i can do it with an applescript but
> there has got to be another way.

dim f as folderitem

f = getopenfolderitem("Application")
if f <> nil then
        f.launch
end if

Or use the "launchFolderItem" method of the "File Additions 0.6" module
from
<http://www.monkeybreadsoftware.de/monkeybread/downloads/realbasic/fileA
dditions.sit>.

Paul



Thu, 03 Jul 2003 19:55:44 GMT  
 starting another program from within realbasic
paul,

thx a lot.  "LAUNCH" is what was getting me.....  I kept using "RUN"

again thx,
ralph

Quote:


> > how can i get an realbasic application to start up a separate
> > application located in a folder?  i can do it with an applescript but
> > there has got to be another way.

> dim f as folderitem

> f = getopenfolderitem("Application")
> if f <> nil then
>         f.launch
> end if

> Or use the "launchFolderItem" method of the "File Additions 0.6" module
> from
> <http://www.monkeybreadsoftware.de/monkeybread/downloads/realbasic/fileA
> dditions.sit>.

> Paul



Fri, 04 Jul 2003 00:05:13 GMT  
 starting another program from within realbasic
oh one last thing.

how do i get realbasic to select an application automatically in a given
folder without having to select it from a menu window. What i am trying to
do is have a button run an external applescript.  The Getopenfolderitem
creates a window menu, which i then have to select the script from the
list.

thx again,
ralph

Quote:


> > how can i get an realbasic application to start up a separate
> > application located in a folder?  i can do it with an applescript but
> > there has got to be another way.

> dim f as folderitem

> f = getopenfolderitem("Application")
> if f <> nil then
>         f.launch
> end if

> Or use the "launchFolderItem" method of the "File Additions 0.6" module
> from
> <http://www.monkeybreadsoftware.de/monkeybread/downloads/realbasic/fileA
> dditions.sit>.

> Paul



Fri, 04 Jul 2003 01:36:50 GMT  
 starting another program from within realbasic
I got it finally!  I was having problem with the path....

I had to do this :

  f=GetFolderItem("foldername")

  path=f.absolutepath+applicationname
  f=GetFolderItem(path)

  f.launch

but why doesn't this work?:

f=GetFolderItem("flodername:apllicationname")
f.launch

thx



Fri, 04 Jul 2003 04:08:28 GMT  
 starting another program from within realbasic

Quote:

> I got it finally!  I was having problem with the path....

Ugh!  Don't use paths!

Quote:
> I had to do this :

>   f=GetFolderItem("foldername")

>   path=f.absolutepath+applicationname
>   f=GetFolderItem(path)

Don't do this.  Instead, do:

  f =  GetFolderItem("foldername").Child(applicationname)
  f.Launch

Quote:
> but why doesn't this work?:

> f=GetFolderItem("flodername:apllicationname")
> f.launch

Because this would look for a file called "applicationname" on a disk
called "foldername" by the rules of classic MacOS pathnames.  But you
shouldn't do this anyway, because (1) paths are different under Win32
and Mac OS X, and (2) you don't understand the rules of classic MacOS
pathnames anyway.  ;)

f.AbsolutePath should only be used for displaying something to the
user.  It should *not* be used for constructing folder items -- there's
almost always a better way.

Cheers,
- Joe

--
,------------------------------------------------------------------.
|    Joseph J. Strout         Check out the Mac Web Directory:     |

`------------------------------------------------------------------'



Sat, 05 Jul 2003 00:05:58 GMT  
 starting another program from within realbasic
gorgeous..... simple and eloquent!

thx man

Quote:



> > I got it finally!  I was having problem with the path....

> Ugh!  Don't use paths!

> > I had to do this :

> >   f=GetFolderItem("foldername")

> >   path=f.absolutepath+applicationname
> >   f=GetFolderItem(path)

> Don't do this.  Instead, do:

>   f =  GetFolderItem("foldername").Child(applicationname)
>   f.Launch

> > but why doesn't this work?:

> > f=GetFolderItem("flodername:apllicationname")
> > f.launch

> Because this would look for a file called "applicationname" on a disk
> called "foldername" by the rules of classic MacOS pathnames.  But you
> shouldn't do this anyway, because (1) paths are different under Win32
> and Mac OS X, and (2) you don't understand the rules of classic MacOS
> pathnames anyway.  ;)

> f.AbsolutePath should only be used for displaying something to the
> user.  It should *not* be used for constructing folder items -- there's
> almost always a better way.

> Cheers,
> - Joe

> --
> ,------------------------------------------------------------------.
> |    Joseph J. Strout         Check out the Mac Web Directory:     |

> `------------------------------------------------------------------'



Sat, 05 Jul 2003 09:53:50 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Q: How do I start an application from within a realbasic application

2. starting other programs from within python

3. Problems starting VB programs from within wish

4. starting a python program from within xemacs

5. Monitor CPU load within REALbasic under OSX

6. Getting started learning RealBasic

7. I need a timestamp in milliseconds that starts when my program starts

8. Calling FoxPro program from within Clipper program

9. Calling REXX programs from within an assembler program

10. executing dos program within program

11. Q: Executing programs from within a program

12. Calling a python program within a python program

 

 
Powered by phpBB® Forum Software