Page 1 of 1

How can I see all scripts in stack?

Posted: Sun Sep 04, 2011 12:11 am
by jpottsx1
I'm sure this is easy and I've overlooked it somehow, but I need to know how can I see all scripts in stack in one place?

I am hoping that I can see the scripts one after the other without having to click thru to view each script.

Re: How can I see all scripts in stack?

Posted: Sun Sep 04, 2011 4:06 am
by dunbarx
There are a few utilities written for this purpose. You will hear about them very shortly.

But just for kicks, can you write a script that cycles through all the objects on all the cards, creating a text file that could be seen at once? Remember to title each script with the name and location of the object that it was associated with.

Craig Newman

Re: How can I see all scripts in stack?

Posted: Sun Sep 04, 2011 7:01 am
by bn
Hi Jeff,

have a look here

http://revonline2.runrev.com/stack/282/Script-Reporter
and there is another one based on above script-reporter by D. Glass. Search for script reporter. You can also access revOnline from within Livecode: user samples

Kind regards

Bernd

Re: How can I see all scripts in stack?

Posted: Sun Sep 04, 2011 6:15 pm
by jpottsx1
Thanks for the link it looks good. But is there a way to also be able see all the scripts, then bulk edit the scripts with search and ?

Re: How can I see all scripts in stack?

Posted: Sun Sep 04, 2011 6:43 pm
by bn
Hi Jeff,

if you want to do a find/replace then you can do that natively. In the Edit Menu > Find and Replace. Choose Stack, make shure "script" is the only option ticked. Do a search. If there was a hit then enlarge the window by dragging in the bottom-right corner, you will see all occurences of the search term. (You can double-click on the listed object where the object was found to go directly to the script) At the bottom you have the option to replace, enter the new term and it will replace all occurences of your search term in whatever you had chosen, card, stack, all open stacks etc.

BUT please be careful, work on a copy of your stack. The replace function also replaces partial matches. That got me a while ago. Use spaces to mark a word if the search term is a word, etc. Make shure your search term is unambiguous.

A search for mouse and a replace RAT would give you "on RATup". Livecode does not like: on RATup / end RATup

If you want to write/edit whole scripts outside of the script editor you could probably hack the script reporter to set the scripts of the objects to the changed scripts.

Kind regards

Bernd

Re: How can I see all scripts in stack?

Posted: Tue Sep 06, 2011 9:09 am
by kevin11
bn wrote:Livecode does not like: on RATup / end RATup
why not ? That's speciesism. And it's not a rat, it's a hamster.

Re: How can I see all scripts in stack?

Posted: Tue Sep 06, 2011 9:33 am
by bn
Hi Jeff,
And it's not a rat, it's a hamster.
you already have that build-in,

Code: Select all

on hamsterUp
   -- your expletives here
noEnd hamsterUp
is equivalent to

Code: Select all

on mouseUp
   repeat forever
   -- your expletives here
end mouseUp
Wheras

Code: Select all

on RATUp
   -- RATS!
end RATUP
is more specific

recurse and the world curses with you

That's speciesism
Is that a Homo sapiens sapiens speaking? :)

Kind regards

Bernd (Rattus Rattus)