My first completed app; free plugin

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Location: Kent, UK
Contact:

My first completed app; free plugin

Post by gyroscope » Tue Apr 28, 2009 12:23 am

Hi, I've finished my first app ever; it's a stack best used as a Plugin called My Script Collector, a straightforward app to collect Rev scripts.

It can be downloaded from RevOnline (2.9 or 3.0 RevOnline only as I couldn't connect to the server on 3.5) > gyroscope > My Script Collector.

This plugin will not work in 2.9 though; 3.0 or 3.5 is fine. i've tested it on a Mac only, but should be fine on Windows or Linux as well.

If anyone has any improvements or find any bugs please let me know. It'd be great to know if you find it useful as well...

Thank you to Rev forum members for your help and a special thanks to SparkOut, Mark Schonewille and especially Bernd Niggemann without whose help I wouldn't have been able to write the app at all.

There isn't a Help File but it's pretty much straightforward to use.

Finally, i hope it's OK that I'm going to double post this.

:)

gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Location: Kent, UK
Contact:

Post by gyroscope » Tue Apr 28, 2009 12:11 pm

Whoops, I forgot to put in "save stack"; silly me :oops: (or worse... :wink:)

Apologies there; I'll be temporarily taking the stack off of RevOnline and repost it some time tonight.

:)

gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Location: Kent, UK
Contact:

Post by gyroscope » Wed Apr 29, 2009 12:21 am

Hi, I've uploaded My Script Collector again; but I'm going to call it a beta version. This is because sometimes the stack won't move and the minimize doesn't work; both these problems occur when the stack is used as a plugin.

I'd be great if someone could tell me why this is happening... :(

Edit: latest version in RevOnline 2.9 or 3.0; moving window works now but minimize stilll doesn't work.

Apologies for all of this; I should have made sure it was working before I posted it...

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am
Location: London, UK

Post by marksmithhfx » Thu Apr 30, 2009 2:59 am

Hi Gyroscope, I'm just getting started... what does a script collector do exactly? Also, I'm not familiar with the revonline thing you described. Could you post a link? Thanks

gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Location: Kent, UK
Contact:

Post by gyroscope » Thu Apr 30, 2009 10:30 am

Hi Mark
what does a script collector do exactly?
As you progress with Rev, you'll find other people's code to use or amend, as well as your own code; some of which you'll reuse in your different stacks. So a Script collector is a program to keep all of your collected code in one convenient place; as well as being able to instantly add code from a stack you've opened or one that you're working on; or copy and paste from it to the stack.

The alternative is to collect sample code as Forum posts or stacks, saved in a folder. So a program that you can run in Rev, in tandem with a stack you are working on, is much more convenient.
Also, I'm not familiar with the revonline thing you described.
RevOnline is a place where Rev users can upload stacks to share with other people. There are two "types"; one is the older style which can be found in Rev 2.9 and 3.0, the other is the latest version, which looks and works a bit differently, which can be found in Rev 3.5. Some people are having trouble connecting to the server for RevOnline 3.5, so I've uploaded my stack "My Script Collector" to the older version.

To get to the stack, click on RevOnline in version 2.9 or 3.0; this can be found to the left of the Documentation icon, under the menu bar.

So the link is: RevOnline > User Spaces > Browse Users > gyroscope > My Script Collector

One important point: this will only run in Rev 3.0 or 3.5 (although as I say, you can download it via 2.9).

The program is best run as a plugin; in case you don't know about this I'll describe the process for you: once you've downloaded the app, drag it to the Plugins folder in you Rev 3.0 or 3.5 folder.

Now when you open Rev, you go to Development > Plugins > My Script Collector 8 to get the prog running.

I've made 36 buttons with different sections, so say you have some code in a stack script to do with Fields that you want to keep in the Script Collector, you would click on the Text button, click New, give it a title, write some notes if you want to, then drag the script into the script area, then press Apply. You can add as many other entries to this or any other section as you want.

By the way, you can change the order of the buttons by holding Command down and dragging; or change the headings by holding alt down on any of the buttons.

It automatically saves all of your entries, so next time you open it, all of your saved scripts will be there for you to reuse the code or add more.

:)

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4016
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Post by bn » Thu Apr 30, 2009 1:54 pm

Gyroscope,

very very nicely done. Congrats.

It turns out to look nice and has a nice functionality.

I did not test it very intensively yet, but it works.

for the animation of the buttons I propose a little change so that the buttons that move are on top of the other buttons. Just a little visual thing.
insert this code in the mouseUp and add the tMaxLayer to the script local variables

Code: Select all

local tmyOrigLoc, tTrackOn, tMaxLayer
on mouseDown
    if not (the commandkey is down) then
        check2
    else
        put the loc of me into tmyOrigLoc 
        put true into tTrackOn 
        -------------insertion
        -- move it to the front so it is alway visible 
        set the relayergroupedcontrols to true
        put empty into tLayers
        repeat with i = 1 to the number of controls of group id 1003 
            put the layer of control i of group id 1003  & comma after tLayers
        end repeat
        delete last char of tLayers
        put max (tLayers) into tMaxLayer
         
        set the layer of me to tMaxLayer
       -------------insertion end
        # THE CLICK POSITION
and in the 'on trackMe' handler insert

Code: Select all

if tFoundOne then 
            -- a little animation 
            -------------insertion
            set the layer of button id tanID to tMaxLayer-1 -- let the button be seen
       -------------insertion end
since you stay within the layers of the group you do not "layer out" the buttons
regards
Bernd

gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Location: Kent, UK
Contact:

Post by gyroscope » Thu Apr 30, 2009 5:02 pm

very very nicely done. Congrats.
Thank you, Bernd, I couldn't have done it without your invaluable help.
I propose a little change so that the buttons that move are on top of the other buttons
I did try using relayerGroupedControls but despite Klaus' Warning, still mucked it up! I like the way you've set the layer to the top within the group only; I guessed that was what was needed but couldn't work it out.

I'll apply your script some time this evening and post an updated version.

Thanks again.

:)

PS You probably noticed that I didn't put the buttons scripts as a behaviour script; this was because each button has its own page to go to, but now I think of it I could have got each button to fire a variable then put that into the master script. Ah well, all done now!

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4016
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Post by bn » Thu Apr 30, 2009 7:32 pm

I just noticed that with the changing of the layering your button "1" will not be button one anymore instead Rev resolves to button 1, which is another button after relayering, so reopening your stack will hilite the wrong button. It is mentioned in the pdf names can be anything but have to start with an underscore or a letter. So button "_1" would be ok. I once started the name of a button with a minus, because I wanted it to point to next card like "-> next", it crashed the stack until I found out about this. Ever since I am very conservative in naming controls. You can get away with some naming and only have 'unexpected' results like in your case, it could be the reason for much more....
regards
Bernd

gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Location: Kent, UK
Contact:

Post by gyroscope » Thu Apr 30, 2009 8:51 pm

Thanks for pointing that out Bernd, I'll bear that in mind. Hopefully it doesn't influence the relayergroupcontrols script though; but could cause problems elsewhere as you mentioned.

I'll rename them and change the scripts accordingly.

:)

Edit: All corrected: latest version can be downloaded from

RevOnline > User Spaces > Browse Users > gyroscope > My Script Collector

One important point: this will only run in Rev 3.0 or 3.5 (although as I say, you can download it via 2.9).

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4016
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Post by bn » Sun May 03, 2009 7:59 pm

gyroscope,
I see you have applied the changes to your scriptcollector.

a couple of observations:
tabbing into the list of scripts it takes two arrowkeys to change the selected line remedy:

Code: Select all

on focusIn
   -- when tabbing into the field it takes two arrowkeys to work
   select line (word 2 of the selectedline of me) of me
end focusIn
if you add this to the field "allentries" then the first arrowkey works. Dont ask me why. I found this by experimenting but there is probably a reason.
on openstack you still

Code: Select all

send "mouseUp" to button "1"
which is not the button 1 you initially expected. When shuffling around the buttons the layering changes, but you know that. How about storing the button name in a custom property before closing and then restoring that selection.

When I put in a new entry and than click "New" the entry disapears. I have to click the apply button. Suggestion: either check for entry in the entry field before allowing the New action. Or just save what is in the entry and create a new entry when the user clicks the New button first.
The way it is now it is a little confusing for a new user of your stack.

I really like the layout of your scriptcollector. I is a nice piece of software.

How about a card that shows all entries of all the different sections: after using it a while I probably dont remember where I put my snippet, was it in images, dial/knobs or animation ? But may be this is for version 2.0 :)
Thank you, Bernd, I couldn't have done it without your invaluable help
well, actually I like these problems that come up on the forum and I learn the most from them so I am also/mostly helping myself and I have to thank the forum and you for throwing up these problems :) and not to forget Mark Schonewille for his stack showing the use of the custom properties. And Scott Rossi and so on.

One way to look at Revolution is that you have an evolved piece of technology that is well, 'underdocumented' and let the users find out what to do with it and the users teach each other. A little bit like 'the hole in the wall' experiment they were talking about on the list the other day. http://www.ted.com/index.php/talks/suga ... elves.html
(really worthwile watching, especially the videos of the kids starting from about six/seven minute into the talk for the always hurried, 20 minutes well spend)

regards
Bernd

gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Location: Kent, UK
Contact:

Post by gyroscope » Mon May 04, 2009 1:15 pm

Hi Bernd

Code: Select all

on focusIn 
   -- when tabbing into the field it takes two arrowkeys to work 
   select line (word 2 of the selectedline of me) of me 
end focusIn
if you add this to the field "allentries" then the first arrowkey works. Dont ask me why. I found this by experimenting but there is probably a reason.
I'll weave this in to the script, thanks. How you discovered that one, I don't know!
on openstack you still

Code: Select all

send "mouseUp" to button "1"
which is not the button 1 you initially expected.
I changed the button names as per your previous suggestion to "B1", "B2', etc but forget to amend that line. Scripting:

Code: Select all

send "mouseUp" to button "B1"
seems to work now.
When I put in a new entry and than click "New" the entry disapears. I have to click the apply button. Suggestion: either check for entry in the entry field before allowing the New action. Or just save what is in the entry and create a new entry when the user clicks the New button first.
The way it is now it is a little confusing for a new user of your stack.
I totally agree there Brnd, I've been struggling with that mini problem for a while. I'm going to go with hiding the fields (except the list field) until the "New" button is pressed; I'll see how that works out.
How about a card that shows all entries of all the different sections: after using it a while I probably dont remember where I put my snippet, was it in images, dial/knobs or animation ? But may be this is for version 2.0 :)
That's a bit beyond me at this stage so yes, I'll leave that for version 2.0 :)
One way to look at Revolution is that you have an evolved piece of technology that is well, 'underdocumented' and let the users find out what to do with it and the users teach each other. A little bit like 'the hole in the wall' experiment they were talking about on the list the other day.
Yes, there's a lot undocumented but it's great we can all help each other, especially on this Forum. Rev can be wonderful one day and downright frustrating the next...but I can safely say that personally, it has become my most used app.

The Hole in the Wall experiment is fascinating; how quickly children, with their fresh minds, can learn, and without the help of teachers! I wish there had been computers when I was a school; the closest was a machine the size of a small portable TV for inputting two numbers and the result given in a set of lights, as binary.

:)

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4016
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Post by bn » Mon May 04, 2009 3:36 pm

Gyroscope,

what happens, if a user of the script collector has the bright idea to sort the cards? Lets say by field "allentries" to have the ones with entries in front?
Because he decides it is easier to go through the cards by navigational commans like command 3 for next card and he wants the cards with entries to come first.
You might want to give the cards names, maybe the same as the buttons that link to these cards. Then you could say go card the short name of me in the buttons.

set the cantdelete of the cards to true.

you get the idea.

I dont want to bug you with this. These are all things that happened to me and I learned it the hard way. Users can be very resourceful. I even have some, that have a way to kill my apps in no time. Not because they are especially skillful but because they approach the app from a different persepective then I did. I would never do this with "my" app, because I developed it. But they find perfectly legitimate ways that were not taken into account by me in the first place.

regards
Bernd

gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Location: Kent, UK
Contact:

Post by gyroscope » Mon May 04, 2009 6:59 pm

Hi Bernd
what happens, if a user of the script collector has the bright idea to sort the cards?....................Users can be very resourceful. I even have some, that have a way to kill my apps in no time.
You are so right about users "doing the unexpected" but to be honest Bernd, I'll only be going so far with this app as I soon want to concentrate on my potential "commercial" apps (five in different stages of progress). You are correct though that one must account for every eventuality, especially in commercial apps.

I'm hoping that the majority of users of My Script Collector will stick to using the button sections, and in that way, it doesn't really matter what card is being used! (But thank you for the suggestion).

:)




Added: MyScript Collector would be perfect for another app I'll be making but in this one there would a photo saved in each record.

I guess the approach would be to have a hidden field which would be the picture's location on the user's drive, and that could be woven into the custom property/array script, used to call up the image when that particular record set is chosene but I wonder what the best way would be to do that, do you happen to know please, Bernd :?:

I would think a straightforward bit of script for importing/exporting images would do the trick but I haven't been in that territory before...

(I think I might be asking a bit too much here... :wink: )

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am
Location: London, UK

Re: My first completed app; free plugin

Post by marksmithhfx » Thu Aug 11, 2011 10:47 pm

Does anyone still have a copy of My Script Collector by gyroscope? I cannot seem to find it anywhere but the chatter back and forth between Bernd and gyroscope has me intrigued.

Thanks

-- Mark
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4016
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: My first completed app; free plugin

Post by bn » Thu Aug 11, 2011 11:53 pm

Hi Mark,

I tried to access revOnline (the old one of version pre 3.5) but it gave me a server error.

Maybe Gyroscope reads this and can post a link to his stack. Or you try to reach him via MySpace address following the link in his posts.

It was a nice project touching a couple of important concepts. Mainly to use arrays and custom properties as a sort of "database" with just one card that displays all the entries, inspired by Mark Schonewilles example stack, also on the old revOnline I believe. Plus some interface tweaks with buttons on could reorder by dragging them and the buttons would switch place. This was heavily inspired by Scott Rossi's examples.
http://www.tactilemedia.com/index.html? ... rials.html
get in line

At that time you also posted to this thread :)

Kind regards

Bernd

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”