Is it possible... (Real Studio network user group Mailinglist archive)

Back to the thread list
Previous thread: hard stuff... for me at least!
Next thread: Printing A Listbox


[OT] How to compile Carbon Shared Library w/ProjectBuilder?   -   Hadley, Joshua
  Is it possible...   -   Ken & Deb Allen
   Re: Is it possible...   -   Joseph J. Strout
    Deleting in 4D65   -   Maximilian Tyrtania
    Re: Is it possible...   -   Ken & Deb Allen
     Re: Is it possible...   -   Joseph J. Strout
    Re: Is it possible...   -   Ken & Deb Allen
     Re: Is it possible...   -   Steve Goodman
     scripting the IDE (was Re: Is it possible...)   -   Joseph J. Strout

Is it possible...
Date: 12.12.02 16:37 (Thu, 12 Dec 2002 10:37:19 -0500)
From: Ken & Deb Allen
to use Applescript to load the individual files of a 'package' into a
REALbasic project in the proper order?

For example, consider the XML toolkit provided by Amar Sagoo contains a
series of files, at least one of which needs to be loaded before others
that would alphabetically come before it. Also, these 'packages' are
typically located within a folder within the project.

So, how difficult would it be to create an AppleScript that would
create a folder in the current RB project (with the appropriate name)
and then add files from a specified directory into that project folder?
Could someone provide a template for this that could then be
edited/tailored for specific 'packages'?

I suppose that if this can be done, it would also be possible to define
a generic AppleScript that would prompt for a file that contains the
name of the project folder to be created and the list of files to be
loaded. In this way a single AppleScript could be used, and each
package would simply need to include a control file that describes the
'package'.

-Ken

---
A searchable archive of this list is available at:
<http://dbserver.realsoftware.com/KBDB/search.php>

Unsubscribe:
<mailto:<email address removed>>

Subscribe to the digest:
<mailto:<email address removed>>

Re: Is it possible...
Date: 12.12.02 16:49 (Thu, 12 Dec 2002 07:49:20 -0800)
From: Joseph J. Strout
At 10:37 AM -0500 12/12/02, Ken & Deb Allen wrote:

>to use Applescript to load the individual files of a 'package' into
>a REALbasic project in the proper order?

Might be. Just tell the Finder to open each one with REALbasic...
it's wortha try.

>For example, consider the XML toolkit provided by Amar Sagoo
>contains a series of files, at least one of which needs to be loaded
>before others that would alphabetically come before it.

Best way to handle this, I think, is to sort the parts into
subfolders, such that all the base stuff comes in the first subfolder
and dependent stuff comes in a second one (or no folder at all). Or,
just name the items with "00", "01", etc. at the front (the file
names don't have to match the item names in RB).

Cheers,
- Joe

Re: Is it possible...
Date: 12.12.02 18:50 (Thu, 12 Dec 2002 12:50:38 -0500)
From: Ken & Deb Allen
How does one invoke an AppleScript from inside the RB IDE that can
execute against the currently open project? For example, can I execute
a script from the Extras menu?

I have done a large amount of scripting over the years, but I have not
written a lot of Applescript. Are the tools for editing an AppleScript
against the RB dictionary a standard part of MacOS X, or do I need to
add something to my system?

Are there any sample AppleScripts that run against the RB IDE that I
could examine?

-ken

On Thursday, December 12, 2002, at 11:35 AM, REALbasic Network Users
Group wrote:

> Subject: Re: Is it possible...
> From: "Joseph J. Strout" <<email address removed>>
> Date: Thu, 12 Dec 2002 07:49:20 -0800
>
> At 10:37 AM -0500 12/12/02, Ken & Deb Allen wrote:
>
>> to use Applescript to load the individual files of a 'package' into
>> a REALbasic project in the proper order?
>
> Might be. Just tell the Finder to open each one with REALbasic...
> it's wortha try.
>
>> For example, consider the XML toolkit provided by Amar Sagoo
>> contains a series of files, at least one of which needs to be loaded
>> before others that would alphabetically come before it.
>
> Best way to handle this, I think, is to sort the parts into
> subfolders, such that all the base stuff comes in the first subfolder
> and dependent stuff comes in a second one (or no folder at all). Or,
> just name the items with "00", "01", etc. at the front (the file
> names don't have to match the item names in RB).
>
> Cheers,
> - Joe

---
A searchable archive of this list is available at:
<http://dbserver.realsoftware.com/KBDB/search.php>

Unsubscribe:
<mailto:<email address removed>>

Subscribe to the digest:
<mailto:<email address removed>>

Re: Is it possible...
Date: 12.12.02 19:27 (Thu, 12 Dec 2002 10:27:54 -0800)
From: Joseph J. Strout
At 12:50 PM -0500 12/12/02, Ken & Deb Allen wrote:

>How does one invoke an AppleScript from inside the RB IDE that can
>execute against the currently open project? For example, can I
>execute a script from the Extras menu?

Yes.

>I have done a large amount of scripting over the years, but I have
>not written a lot of Applescript. Are the tools for editing an
>AppleScript against the RB dictionary a standard part of MacOS X, or
>do I need to add something to my system?

They are standard (look for "Script Editor").

>Are there any sample AppleScripts that run against the RB IDE that I
>could examine?

You can make your own samples, but turning on Recording in Script
Editor, then doing an operation (such as changing your build settings
or doing a build) in RB, then going back to Script Editor and
stopping the recording.

But the script you were describing before would be scripting the
Finder, not RB. Unfortunately the OS X Finder is not recordable, or
wasn't the last time I checked.

Cheers,
- Joe

Re: Is it possible...
Date: 13.12.02 16:03 (Fri, 13 Dec 2002 10:03:08 -0500)
From: Ken & Deb Allen
Unfortunately, even RB does not support the basics!

I started Script Editor and pressed Record; then I went to an RB
project and added a folder -- nothing was recorded! RB also supports an
IMPORT menu item to add external files to a project -- this does not
script, either.

It seems a rather nice feature to be able to create a 'package', like
the XML Toolkit, and then have RB add that 'package' in its entirety
(optionally as an alias reference) to an existing project in a folder.
I have submitted an enhancement request.

-Ken

On Thursday, December 12, 2002, at 06:09 PM, REALbasic Network Users
Group wrote:

> Subject: Re: Is it possible...
> From: "Joseph J. Strout" <<email address removed>>
> Date: Thu, 12 Dec 2002 10:27:54 -0800
>
> At 12:50 PM -0500 12/12/02, Ken & Deb Allen wrote:
>
>> How does one invoke an AppleScript from inside the RB IDE that can
>> execute against the currently open project? For example, can I
>> execute a script from the Extras menu?
>
> Yes.
>
>> I have done a large amount of scripting over the years, but I have
>> not written a lot of Applescript. Are the tools for editing an
>> AppleScript against the RB dictionary a standard part of MacOS X, or
>> do I need to add something to my system?
>
> They are standard (look for "Script Editor").
>
>> Are there any sample AppleScripts that run against the RB IDE that I
>> could examine?
>
> You can make your own samples, but turning on Recording in Script
> Editor, then doing an operation (such as changing your build settings
> or doing a build) in RB, then going back to Script Editor and
> stopping the recording.
>
> But the script you were describing before would be scripting the
> Finder, not RB. Unfortunately the OS X Finder is not recordable, or
> wasn't the last time I checked.
>
> Cheers,
> - Joe

---
A searchable archive of this list is available at:
<http://dbserver.realsoftware.com/KBDB/search.php>

Unsubscribe:
<mailto:<email address removed>>

Subscribe to the digest:
<mailto:<email address removed>>

Re: Is it possible...
Date: 13.12.02 19:39 (Fri, 13 Dec 2002 12:39:19 -0600)
From: Steve Goodman
Just because its not recordable doesn't mean it's not scriptable. Here's a
snippet of the rb dictionary:

REALbasic Suite : Commands unique to the REALbasic application

ImportItem: Imports the item given as a project item in the current project
ImportItem

ExportItem: Exports the current project item of the current project
ExportItem
in null -- File in which to export the object
as null -- File type of the document in which to export the data

build: make an executable application with the current build settings
build [reference] -- project (document) to build

run: runs (or resumes) the specified project within the IDE
run [reference] -- project (document) to run

So it looks as though you can import into rb with AS. There are a lot more
commands in the standard suite. Just drop the rb app onto script editor to
see the dictionary.

Steve

> From: Ken & Deb Allen <<email address removed>>
> Reply-To: "REALbasic Network Users
> Group"<<email address removed>>
> Date: Fri, 13 Dec 2002 10:03:08 -0500
> To: "REALbasic Network Users Group" <<email address removed>>
> Subject: Re: Is it possible...
>
> Unfortunately, even RB does not support the basics!
>
> I started Script Editor and pressed Record; then I went to an RB
> project and added a folder -- nothing was recorded! RB also supports an
> IMPORT menu item to add external files to a project -- this does not
> script, either.
>
> It seems a rather nice feature to be able to create a 'package', like
> the XML Toolkit, and then have RB add that 'package' in its entirety
> (optionally as an alias reference) to an existing project in a folder.
> I have submitted an enhancement request.
>
> -Ken
>
> On Thursday, December 12, 2002, at 06:09 PM, REALbasic Network Users
> Group wrote:
>
>> Subject: Re: Is it possible...
>> From: "Joseph J. Strout" <<email address removed>>
>> Date: Thu, 12 Dec 2002 10:27:54 -0800
>>
>> At 12:50 PM -0500 12/12/02, Ken & Deb Allen wrote:
>>
>>> How does one invoke an AppleScript from inside the RB IDE that can
>>> execute against the currently open project? For example, can I
>>> execute a script from the Extras menu?
>>
>> Yes.
>>
>>> I have done a large amount of scripting over the years, but I have
>>> not written a lot of Applescript. Are the tools for editing an
>>> AppleScript against the RB dictionary a standard part of MacOS X, or
>>> do I need to add something to my system?
>>
>> They are standard (look for "Script Editor").
>>
>>> Are there any sample AppleScripts that run against the RB IDE that I
>>> could examine?
>>
>> You can make your own samples, but turning on Recording in Script
>> Editor, then doing an operation (such as changing your build settings
>> or doing a build) in RB, then going back to Script Editor and
>> stopping the recording.
>>
>> But the script you were describing before would be scripting the
>> Finder, not RB. Unfortunately the OS X Finder is not recordable, or
>> wasn't the last time I checked.
>>
>> Cheers,
>> - Joe
>
> ---
> A searchable archive of this list is available at:
> <http://dbserver.realsoftware.com/KBDB/search.php>
> Unsubscribe:
> <mailto:<email address removed>>
> Subscribe to the digest:
> <mailto:<email address removed>>

---
A searchable archive of this list is available at:
<http://dbserver.realsoftware.com/KBDB/search.php>

Unsubscribe:
<mailto:<email address removed>>

Subscribe to the digest:
<mailto:<email address removed>>