Re: One MetaCard Application modifying another--take 2

1999-10-26 Thread Richard Gaskin

>You can control another MetaCard app on Windows with DDE 

I was hoping to do this with FileMaker Pro.  How is this done?



- Richard Gaskin 
  Fourth World
  Multimedia Design and Development for Mac, Windows, UNIX, and the Web
  _
  [EMAIL PROTECTED] http://www.FourthWorld.com
  US: 800-288-5825 Int'l: 323-225-3717Fax: 323-225-0716




Re: One MetaCard Application modifying another--take 2

1999-10-26 Thread Geoff Canyon

I think this will do the trick. 

Thanks!
gc

On 10/26/99 12:26 PM, Scott Raney <[EMAIL PROTECTED]> wrote:

>Another think you might consider is distributing an updater that
>actually builds a new standalone using a new stack and the engine from
>the old standalone.  It's the same kind of process, but much safer
>because it doesn't involve changing the stacks themselves.  You're on
>your own if you want to try this, but you should be able to figure it
>out using the scripts in the standalone builder.
>  Regards,
>Scott



Re: One MetaCard Application modifying another--take 2

1999-10-26 Thread Scott Raney

On Tue, 26 Oct 1999, Geoff Canyon wrote:

(snip)

> I then opened the application with BBEdit, and searched for the text, 
> "This is the really the text to modify." When I found it, I changed it 
> to, "This is some dangerous text to modify." (note the identical 
> character length)
> 
> I saved Mod.app out of BBEdit, and quit BBEdit.
> 
> I ran Mod.app, and clicked the button. Voila! the field contained "This 
> is some dangerous text to modify."
> 
> My questions are:
> 
> 1. Is this dangerous? (obviously, yes)

Yes.

> 2. Is there a way to write another MetaCard application to do this? (also 
> obviously, yes--a MetaCard application could do the same thing I did with 
> BBEdit--the file can be read/written as binary if necessary)

Yes.

> 3. Is there a better way to do this with a MetaCard application? In other 
> words, is it possible with a MetaCard application to do this with 
> something like,
> 
> Set the testProperty of application "Mod.app" to "This is some dangerous 
> text to modify."
> 
> I'm assuming the answer to 3 is no.

Right again.

> 4. If I write an application to go in and hack the string, as in 2, does 
> the string have to stay the same length? (my guess would be yes, but 
> obviously this is dependant on MetaCard's internal data structures, and 
> so is more of a question for Kevin or Scott)

There is no CRC or other bitwise check on stack integrity, so as long
as the string stays the same size, there's no technical reason why you
can't do this.  For some strings, it'd even be possible to change the
length.  For example, most of the things that have a uint2 (64K)
length limit have a 2-byte length stored at the front of them.
Unfortunately changing the length of scripts and custom properties and
other things that don't have this limit isn't practical because the
lengths are stored in different ways for these.

Changing a stack this way is still a dangerous thing to do, though,
and you should be *very* sure that the strings you're replacing are
unique in the stack because it's possible that normal object storage
could generate the source strings.  It's also not possible to do this
in password protected stacks, nor is it possible for a standalone to
modify itself (at least on Windows and UNIX systems), so a separate
application would be required.  And of course, someday we might change
the file format (actually we're about guaranteed to do this), so your
best long-term solution is to store stuff that needs to change in a
separate "preferences" stack.

Another think you might consider is distributing an updater that
actually builds a new standalone using a new stack and the engine from
the old standalone.  It's the same kind of process, but much safer
because it doesn't involve changing the stacks themselves.  You're on
your own if you want to try this, but you should be able to figure it
out using the scripts in the standalone builder.
  Regards,
Scott

> Geoff Canyon
> [EMAIL PROTECTED]
> Your child can learn to read using the classics of children's literature.
> Check out C.D. Caterpillar: 



Scott Raney  [EMAIL PROTECTED]  http://www.metacard.com
MetaCard: You know, there's an easier way to do that...



RE: One MetaCard Application modifying another--take 2

1999-10-26 Thread Marni Centor

Geoff,

You can easily do what you suggested in Question 3. All you need to do is
build another stack to modify mod.app. This stack could have a field and a
button that work as follows:

- User types the new text for testProperty into the field, called "Property
value"
- Button has the script:

on mouseUp
  set the textProperty of stack "mod.app" to the text of fld "Property
value"
  save stack "mod.app"
end mouseUp

Type some text into field "Property value" and click the button. Now open
stack mod.app and click the button. The new textProperty value should appear
in the field. It's really that simple.

The only caveat (and on rereading your message, I guess this is where your
difficulty lies) is that mod.app cannot be a standalone (.EXE) stack, so it
would need to be distributed with an EXE file to start it up, or rebuilt as
a standalone after the modifications are made. But I don't think your
customers would be able to build standalones themselves without a licensed
copy of Metacard, which leaves you back at having your customer distribute
two files -- one of which is a standalone that doesn't have to do anything
but open the customized stack. Why is it a problem for your customers to
distribute two files instead of one?

Regards,
Marni

> Not quite--I don't want my user to have to give _his/her_ 
> user two files. 
> Here's a more concrete example. (Again, apologies, since I 
> obviously have 
> yet to make this clear)
> 
> I just created a small stack with one button, one field, and 
> one custom 
> property.
> 
> The custom property, called "testProperty," contained the 
> text, "This is 
> the really the text to modify"  --that's not a typo in this email, I 
> actually typed it that way in the property by accident.
> 
> The button's script was,
> 
> on mouseUp
>   put the testProperty of this stack into fld 1
> end mouseUp
> 
> I built the stack into an application, Mod.app. When I ran 
> Mod.app and 
> clicked the button, the text, "This is the really the text to 
> modify," 
> appeared in the field. I quit.
> 
> I then opened the application with BBEdit, and searched for the text, 
> "This is the really the text to modify." When I found it, I 
> changed it 
> to, "This is some dangerous text to modify." (note the identical 
> character length)
> 
> I saved Mod.app out of BBEdit, and quit BBEdit.
> 
> I ran Mod.app, and clicked the button. Voila! the field 
> contained "This 
> is some dangerous text to modify."
> 
> My questions are:
> 
> 1. Is this dangerous? (obviously, yes)
> 2. Is there a way to write another MetaCard application to do 
> this? (also 
> obviously, yes--a MetaCard application could do the same 
> thing I did with 
> BBEdit--the file can be read/written as binary if necessary)
> 3. Is there a better way to do this with a MetaCard 
> application? In other 
> words, is it possible with a MetaCard application to do this with 
> something like,
> 
> Set the testProperty of application "Mod.app" to "This is 
> some dangerous 
> text to modify."
> 
> I'm assuming the answer to 3 is no.
> 4. If I write an application to go in and hack the string, as 
> in 2, does 
> the string have to stay the same length? (my guess would be yes, but 
> obviously this is dependant on MetaCard's internal data 
> structures, and 
> so is more of a question for Kevin or Scott)
> 
> Thanks
> 
> 
> 
> Geoff Canyon
> [EMAIL PROTECTED]
> Your child can learn to read using the classics of children's 
> literature.
> Check out C.D. Caterpillar: 
> 
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.



Re: One MetaCard Application modifying another--take 2

1999-10-26 Thread Tuviah M Snyder

>3. Is there a better way to do this with a MetaCard application? In
other 
>words, is it possible with a MetaCard application to do this with 
>something like,

You can control another MetaCard app on Windows with DDE and on Mac with
AppleEvents. Problem is an application is locked while executing, so even
if you were able to modify a standalone you would not be able to save it.

I recall a while ago someone posting a script which strips a standalone
of it's stack. If you can indeed do that then you could load that stack,
then rebuild another standalone at runtime under the same
name(overwriting the previous one).

Another thing you could do is include the stack in the modifier
application. The app would modify the stack,save it, then build a
standalone. This way you would only have to distribute that one app,
which would create as many standalones as needed.

Hope this makes some sense.

regards,
Tuviah Snyder
Diskotek
Custom Application Development & SuperCard/HyperCard Conversion at a low
price



Re: One MetaCard Application modifying another--take 2

1999-10-26 Thread Geoff Canyon

On 10/26/99 4:04 AM, Kevin Miller <[EMAIL PROTECTED]> wrote:

>I think my previous repy covered all of this?  Either the customizer is a
>stack, in which case the main application anticipates it and downloads it or
>opens it from disk at the right time, or its a standalone, in which case it
>must be made to open one of the stacks in the main app that has been saved
>in a seperate file (not part of the executable).
>
>To get a better idea: try building a standalone that goes to a second stack
>in a file, and place a button in that stack to go to a stack in a URL.  In
>the stack you place on the web, have it check the openStacks on preOpenCard,
>find the stack that is stored on disk that originally connected to the web,
>change something about it (e.g. the backColor) then save it.
>
>Regards,
>
>Kevin

Not quite--I don't want my user to have to give _his/her_ user two files. 
Here's a more concrete example. (Again, apologies, since I obviously have 
yet to make this clear)

I just created a small stack with one button, one field, and one custom 
property.

The custom property, called "testProperty," contained the text, "This is 
the really the text to modify"  --that's not a typo in this email, I 
actually typed it that way in the property by accident.

The button's script was,

on mouseUp
  put the testProperty of this stack into fld 1
end mouseUp

I built the stack into an application, Mod.app. When I ran Mod.app and 
clicked the button, the text, "This is the really the text to modify," 
appeared in the field. I quit.

I then opened the application with BBEdit, and searched for the text, 
"This is the really the text to modify." When I found it, I changed it 
to, "This is some dangerous text to modify." (note the identical 
character length)

I saved Mod.app out of BBEdit, and quit BBEdit.

I ran Mod.app, and clicked the button. Voila! the field contained "This 
is some dangerous text to modify."

My questions are:

1. Is this dangerous? (obviously, yes)
2. Is there a way to write another MetaCard application to do this? (also 
obviously, yes--a MetaCard application could do the same thing I did with 
BBEdit--the file can be read/written as binary if necessary)
3. Is there a better way to do this with a MetaCard application? In other 
words, is it possible with a MetaCard application to do this with 
something like,

Set the testProperty of application "Mod.app" to "This is some dangerous 
text to modify."

I'm assuming the answer to 3 is no.
4. If I write an application to go in and hack the string, as in 2, does 
the string have to stay the same length? (my guess would be yes, but 
obviously this is dependant on MetaCard's internal data structures, and 
so is more of a question for Kevin or Scott)

Thanks



Geoff Canyon
[EMAIL PROTECTED]
Your child can learn to read using the classics of children's literature.
Check out C.D. Caterpillar: 




Re: One MetaCard Application modifying another--take 2

1999-10-26 Thread Kevin Miller

On Monday, Oct 25 1999, Geoff Canyon wrote:

> Sorry, I wasn't clear before. Here's the scenario:
>
> 1. Joe, of Joe's Diner, downloads my application, MetaApp.
>
> 2. Joe licenses MetaApp from me.
>
> 3. This gives Joe the right to modify MetaApp slightly and distribute it.
> MetaApp is a way for Joe to display information placed on his web site to
> his clients in a custom environment. MetaApp downloads everything it
> needs from Joe's web site, on the fly, but it needs to know where Joe's
> web site is to get started. One way to do this would be for Joe to
> include a preference file with his copy of MetaApp. But I want to
> simplify things for Joe, so:
>
> 4. Joe uses a second MetaCard application I provide to him,
> MetaAppCustomizer. He enters his web site's address into
> MetaAppCustomizer, and maybe a logo, and points it at his licensed copy
> of MetaApp. MetaAppCustomizer then modifies MetaApp, hard coding Joe's
> web address and logo into it.
>
> 5. From then on, Joe only needs to distribute the one file, MetaApp, to
> his customers--his copy points to his web site.
>
> Is step 4 easy, hard, or somewhere in between? I'm hoping that the object
> structure of MetaApp can be exposed to MetaAppCustomizer, so all I have
> to do is something like,
>
> set the baseAddress of theAppFile to "http://www.joesdiner.com"

I think my previous repy covered all of this?  Either the customizer is a
stack, in which case the main application anticipates it and downloads it or
opens it from disk at the right time, or its a standalone, in which case it
must be made to open one of the stacks in the main app that has been saved
in a seperate file (not part of the executable).

To get a better idea: try building a standalone that goes to a second stack
in a file, and place a button in that stack to go to a stack in a URL.  In
the stack you place on the web, have it check the openStacks on preOpenCard,
find the stack that is stored on disk that originally connected to the web,
change something about it (e.g. the backColor) then save it.

Regards,

Kevin

> Thanks
>
> gc
>
> Geoff Canyon
> [EMAIL PROTECTED]
> Your child can learn to read using the classics of children's literature.
> Check out C.D. Caterpillar: 

Kevin Miller <[EMAIL PROTECTED]> 
Cross Worlds Computing, MetaCard Distributors, Custom Development.
Tel: +44 (0)131 672 2909.  Fax: +44 (0)1639 830 707.



One MetaCard Application modifying another--take 2

1999-10-25 Thread Geoff Canyon

Sorry, I wasn't clear before. Here's the scenario:

1. Joe, of Joe's Diner, downloads my application, MetaApp.

2. Joe licenses MetaApp from me.

3. This gives Joe the right to modify MetaApp slightly and distribute it. 
MetaApp is a way for Joe to display information placed on his web site to 
his clients in a custom environment. MetaApp downloads everything it 
needs from Joe's web site, on the fly, but it needs to know where Joe's 
web site is to get started. One way to do this would be for Joe to 
include a preference file with his copy of MetaApp. But I want to 
simplify things for Joe, so:

4. Joe uses a second MetaCard application I provide to him, 
MetaAppCustomizer. He enters his web site's address into 
MetaAppCustomizer, and maybe a logo, and points it at his licensed copy 
of MetaApp. MetaAppCustomizer then modifies MetaApp, hard coding Joe's 
web address and logo into it.

5. From then on, Joe only needs to distribute the one file, MetaApp, to 
his customers--his copy points to his web site.

Is step 4 easy, hard, or somewhere in between? I'm hoping that the object 
structure of MetaApp can be exposed to MetaAppCustomizer, so all I have 
to do is something like,

set the baseAddress of theAppFile to "http://www.joesdiner.com"

Thanks

gc

Geoff Canyon
[EMAIL PROTECTED]
Your child can learn to read using the classics of children's literature.
Check out C.D. Caterpillar: 




Re: One MetaCard Application modifying another

1999-10-25 Thread Kevin Miller

On Saturday, Oct 23 1999, Geoff Canyon wrote:

> If you wanted to give an end user the ability to hardwire some
> customer-specific information into an application, without the use of any
> external files, one way to do it would be to build the application just
> for them, after making the necessary changes to the source stacks.
> Another would be to write a second app to customize the first. Would this
> be an ugly task, opening the target application's file, going to a
> certain offset, and plugging some value in, or would it be possible to,
> for example, set a property on the stacks within a "compiled" MetaCard
> application, without getting into the low-level aspects?

You can't change any stacks actually attached to the executable.  If you
split your stacks into multiple files, you'll be able to modify any of
those.  The other limitation is that you can't set any script that is more
than 10 lines long.  So deal in entire objects, properties, cards or stacks,
rather than setting individual lines of script.  Its easy to create a stack
that you send to the user (or that the user accesses online) that checks the
version of some components, then offers to download new material to update
the odd stack here or there.  Make it easy for you by including a menu
option or button somewhere that accesses the web at a certain address to
download and run the stack there.  Put up a stack which says there are no
updates and test it before release.  If you want to make changes, make them,
then script that stack to download them into the users project.  To make
life even easier, attach a custom property that contains a version number to
each of your stacks before distribution.  That way, you can check and update
the number, rather than havirg to check some specific property or line of
script you know is only in some particular version.

Regards,

Kevin

> Thanks in Advance
>
> gc
>
> Geoff Canyon
> [EMAIL PROTECTED]
> Your child can learn to read using the classics of children's literature.
> Check out C.D. Caterpillar: 

Kevin Miller <[EMAIL PROTECTED]> 
Cross Worlds Computing, MetaCard Distributors, Custom Development.
Tel: +44 (0)131 672 2909.  Fax: +44 (0)1639 830 707.



One MetaCard Application modifying another

1999-10-22 Thread Geoff Canyon

If you wanted to give an end user the ability to hardwire some 
customer-specific information into an application, without the use of any 
external files, one way to do it would be to build the application just 
for them, after making the necessary changes to the source stacks. 
Another would be to write a second app to customize the first. Would this 
be an ugly task, opening the target application's file, going to a 
certain offset, and plugging some value in, or would it be possible to, 
for example, set a property on the stacks within a "compiled" MetaCard 
application, without getting into the low-level aspects?

Thanks in Advance

gc

Geoff Canyon
[EMAIL PROTECTED]
Your child can learn to read using the classics of children's literature.
Check out C.D. Caterpillar: