Attribute to check to find if an object has a script or not.

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Attribute to check to find if an object has a script or not.

Post by quailcreek » Sat Feb 27, 2010 12:17 am

Hello again,
I'm pretty sure I've seen a script for this before but I'm not sure where. I searched here but no-joy. Anyway, what I want to do is write all of the scripts in a stack to a word file. I think I can write it but I need to know what attribute to check to determine if an object has a script.

Thanks, again,
Tom
Tom
MacBook Pro OS Mojave 10.14

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Re: Attribute to check to find if an object has a script or not.

Post by BvG » Sat Feb 27, 2010 12:39 am

if the script of <object reference> is not "" then put the script of <object reference>
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10057
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Attribute to check to find if an object has a script or not.

Post by FourthWorld » Sat Feb 27, 2010 2:31 am

Just curious about the workflow: what do you find helpful about reading scripts in Word?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Re: Attribute to check to find if an object has a script or not.

Post by quailcreek » Sun Feb 28, 2010 10:16 pm

I'm not actually put the script in word to read them. I just wanted to be able to print all scripts to be able to catch errors.
Tom
MacBook Pro OS Mojave 10.14

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10057
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Attribute to check to find if an object has a script or not.

Post by FourthWorld » Sun Feb 28, 2010 11:02 pm

What sorts of errors do you find in reading that aren't caught with compilation, execution, and explicitVariables?

My interest here is in earnest: I used to use script dumpers some years ago, but in more recent years have begun putting together some script analysis tools to do those jobs faster. If I can understand what you're looking for I may be able to provide a tool to do it more easily.

I appreciate your taking the time to explain this in more detail. Thanks.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Re: Attribute to check to find if an object has a script or not.

Post by quailcreek » Mon Mar 01, 2010 3:25 am

Hi Richard,
Let me put some thought into my reply and I’ll get back.

Thnaks,
Tom
Tom
MacBook Pro OS Mojave 10.14

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Re: Attribute to check to find if an object has a script or not.

Post by quailcreek » Tue Mar 02, 2010 8:35 pm

Hi Richard,
I need to restate my interest in printing the scripts of my projects. I tend to build my applications in modular fashion as I’m sure most developers do. This makes it easier to find errors before the projects completion. What I wanted to do is be able to see all of the scripts across multiple stacks. The reason is that many of my application contain several stacks and if I make a change in one I want to double check to see if it will impact the rest of the scripts in the other stacks. This is even more important given the nature of a truly object oriented language like Rev. i.e. code in every conceivable location. I’m also an incessant tweaked. I’m continually going back over my code to see if I can make it simpler or quicker. I find that hard to do on screen. I hope this gives you the feedback you were looking for.

Regards,
Tom
Tom
MacBook Pro OS Mojave 10.14

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10057
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Attribute to check to find if an object has a script or not.

Post by FourthWorld » Tue Mar 02, 2010 11:49 pm

Thanks for the info, Tom. It seems the key here is to be able to search scripts effectively, and it's less important whether the scripts are in a text file or the objects so long as you can find what you're looking for.

Being too lazy to dump-and-search, I wrote a little utility some time ago which searches the scripts of every object in a given stack, or every object in the current message path. While it doesn't currently handle multiple stacks that aren't in the message path (it will later), it may be helpful you as it is.

You can grab it in the Stacks section of RevNet: in Rev, see Development->Plugins->GoRevNet

The stack is titled "4W_ScriptSearch".

Hope it helps. I'll try to remember to drop a note here when I update it to handle multiple stacks.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply