Quick navigation:

Introduction
Licensing
Release notes

Online demo
Download
Test page 1
Test page 2

Recently added
Example stacks
Live demos
User submissions

Archived:
 v141-180
 v181-220

Footnote

Webtalk (beta v227)

Webtalk is a web-implementation of HyperTalk. That doesn't mean you have to be online to run it. You can download it and run it from a computer with no internet connection.

What's HyperTalk?

That's another topic, which I'll expand upon a bit further down. If you never had a chance to get into the hypertalk language, you really are missing out. HyperTalk was the scripting language used in HyperCard. There's lots of ways you can experience what HyperCard was (is) today.

So what does webtalk do?

Webtalk is loosely based on the HyperTalk scripting language, and the goal is to be compatible in most major respects. There are additions to it and perhaps things missing from it. The boring bit is I'm not implying it's fit for any particular purpose, and there's no guarantees implied or otherwise about how it might run on your system. (Being based on Javascript and CSS, it heavily relies on what your browser is capable of).

The point of it is it's a programming language that's easy to type and understand. For example, If I wanted to output the current date in javascript, I'd have to type:

Javascript Code:

const now = new Date();
 const days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
 const dayName = days[now.getDay()];
 const dateTimeString = now.toLocaleString();
 document.getElementById('datetime').textContent = `${dayName}, ${dateTimeString}`;

Javascript Result:

And although to do that in Python is simpler, it's not as readable:

Python Code:

from datetime import datetime
 now = datetime.now()
 formatted = now.strftime("%A, %d/%m/%Y, %H:%M:%S")
 print(formatted)

Which again, gives us this:

Python Result:

Whereas, if I want to do that in HyperTalk, I'd be able to use:

Hypertalk Script:

put item 1 of the long date & "," && the date & "," && the time

Hypertalk Result:

However, the great thing about hyperTalk (and webtalk), is that it can also be quite flexible:

put item 1 of the long date & "," && dateFormat(the dateitems, "%d/%m/%Y") & "," && the time
 

HyperTalk script

HyperTalk was the programming language created in 1987 by Dan Winkler, and used in the HyperCard application, created by Bill Atkinson. Creating programs in HyperTalk was known as "scripting". HyperTalk scripts were much more similar to written English than many languages available at the time.

Webtalk script

A simple example of webtalk scripting:

This gives you an idea of what I'm aiming for here, to have something that is platform-agnostic which is capable of running HyperTalk scripts.

I'm trying to give a comparable set of features that were available in Hypertalk, but in Webtalk - so they are available to everyone. As such, there won't be specific Mac-only, Windows-only or Linux-only features implemented on this project. If I add a feature, it will be supported across all platforms.

Current progress:

The current documentation containing the release notes are here, as a PDF

Licensing

You might also want to read the license agreement on that last page of the documentation too.

Download

You can download a copy of webtalk, (current version), from here. You don't need anything special to run it. Just a recent browser (if you are using Safari, needs to be version 17 or above)

Wrappers

Alternatively, you can run it in a wrapper. The wrappers are larger in size because they are akin to a standalone app version. The advantage of the wrapper versions is that they also allow use of the shell (download) command in Webtalk. Note, I don't update these as often as the non-wrapper versions - purely because it's a lot of work. They get updated sporadically.

Online version

Or lastly, if you prefer, you can try it as an online live demo here. You might also want to check out the testing pages, which give you a list of commands and handlers that are currently implemented.

Overview

A project overview (text file) is also available, which covers how this all works at a quick glance.

I should really mention, you can load JSON stacks with:

load stack "" -- if it can't find the file, it will ask you

 


Recent additions:

See the archives (release 141-180 and 181 to 220) for earlier notes.

v221

In this version I've added the selectedText and SelectedChunk commands.

put the selectedChunk of field "myfield" 
 -- would return char x to y of the selected text in the field
 put the selectedText of field "myfield" 
 -- would return the actual string of selected text in the field

I then added the put the curve command curve example-2. This can be used to plot a curve from point A to point B, and you can vary the accentuation of the curve.

I also added shape addition and subtraction for points of a graphic. As well as creating interesting shapes, this can be useful for terrain generation in games.

All of this is covered in the documentation on page 114.

v222

In this version I've added controlAtLoc(x,y) and the inverseAngle property. This is explained on page 116 of the documentation.

v223

Added the scrollBarDrag event for scrollbars:

on scrollbarDrag
   put the thumbPosition of me into field "output"
 end scrollbarDrag

I also added controlWithinRect:

put the controlWithinRect(myRect) into myObjects 
 -- returns a list of all the objects within this rect.
 -- filter out undesired objects with:
 filter myObjects without "*Name*"

This is handy for interactive object types, or situations where you might want to use it for games.

bubble-aimer-test.

It's now possible to hide and show groups too using:

hide group "myGroup"
 -- or
 show group "myGroup"

I also added physics calculation (or the start of), and added pivotPoints and massPoints. gravity-and-mass example.

Testing position and rotation via fields and variables: fix-pos-and-rot.

This is detailed on page 116 of the documentation and onwards.

v224

Added the click at command:

click at 20,20
 click at the loc of button "test"

Simulates a mouse click (mousedown, then mouseup).
Added the copy and paste keyboard shortcut for objects when in edit mode.
Added an 'Align' option. You can find this when in edit mode. (Right-click on an object and you will have alignment choices):

You can now fully control menu popup buttons via script.

You can also get the HTML formatting of any field object -- try it with this table stack 2 (set to a table, then click on the 'put html' button).

Links now properly get saved in version 224 to stack JSON files, and are restored on stack open.link-test-2. No special scripting needed to make the hyperlink appear after a stack load. Testing here with multiple formatting and adding links at the same time.

Added the controlWithinObject for more accurate collision detection.

Added to the gravity-and-mass detection -- now supports colliders, collision events, and rigidbodies.

More information and specifics on page 117 of the documentation (and onwards).

v225

Added quite a bit this time around, as usual I've updated the documentation (page 119 and onwards).

Here's a live demo of changes and additions in version 225 of webtalk.

v226

Numerous improvements, and a bug fix (page 123 of the documentation).

A live demo of changes in version 226 of webtalk.

v227

A couple of bug fixes to do with text editing (page 124 of the documentation).

Added block commenting:

Expanded try-catch errors support.

 


Example stacks:

all-shapes.json
Standard shapes test
star.json
Generating a custom star shape.
8-point-star.json
Slightly different from the previous one, this generates a custom 8-point star shape.
datetests.json
Example stack showing dateitems conversion.
functiontest.json
Example stack showing the use of custom functions.
imagecopy.json
This stack shows how to duplicate image data to another image object. The image data itself is not changed in any way.
toggle-palettes.json
A stack which shows how to toggle the message box and tools palettes.
mouseup-test.json
Shows possible mouseup variants.
webtalk-logo-vid.json
An example video 'player' object showing various logos.
arrowkey-tests.json
This shows how to intercept the arrowkeys when pressed on the keyboard.
opencard.json
This is a demo showing the opencard handler in action.
light-or-dark.json
An example of how to adjust your stack for light or dark appearance. Have a look at the script of the button in the JSON stack.
baseURL.json
This stack uses the baseURL command, and shows how you can detect if webtalk is running online or locally.
keyheld-test.json
Example of using the keyheld message with no keyrepeat delays.
rawkeyup.json
A stack which uses the rawkeyup message in the card script.
rawkeydown.json
A stack which uses the rawkeydown message in the card script.
multiple-keyup.json
A stack showing how to test if a specific key is 'up'
multiple-keydown.json
A stack showing how to test if a specific key is 'down'
keydown-test.json
Stack showing more traditional keydown messages.
pendingmessages.json
Shows the concept of pendingmessages.
pendingmessages-cancel.json
Shows how to cancel individual pendingmessages.
move-example.json
Graphical demo of the move command.
spin.json
Graphical demo of the spin command.
spin-video.json
The spin command, with random rotation.
musical-note-btns.json
Playing musical notes by clicking buttons, using a 'send to' function, and also via keyboard inputs.
count-test.json
Counting the number of objects, and examples of referencing lines of fields and variables.
lineheight.json
Demo stack showing setting variable line heights of fields.
fonts.json
Loading, unloading custom fonts. Getting the font list, and setting fonts of fields.
object-exists.json
How to check if an object exists on the card, using the "if exists" and "if not exists" function.
put-field-test.json
Tests involving putting content from one field to another, or specific lines.
exit-handlername.json
Example showing what it means to exit out of a handler early.
switch-case.json
Demo shows how switch case statements work.
replace-regex.json
Function for regex replacements.
matchtext.json
the matchText function, which is quite powerful.
date-time-long-short.json
Making sure we support short and long time.
dateFormat.json
How to quickly reference any part of the dateItems for easy output.
backgroundPattern.json
This stack is a simple demo of setting a backgroundPattern (a repeating pattern).
answer-colour.json
This shows you how to use the answer colour function, but also how to convert between RGB and Web colour references (or back again).
repeat-until.json
A graphical example of using 'repeat until' logic.
grab-and-intersect-test.json
This shows two approaches to dragging an object, and using the intersect function.<
flip-cards.json
A demo of flipping between two images (setting the imageData).
move-image.json
Example moving an image object around the card via script
background-graphic.json
Showing how to set background patterns on graphic objects (even graphics that are custom shapes).
intersect-test-2.json
This stack shows expanded use of the intersect function, using a transparent PNG as detectable 'collision' areas.
scrollbar.json
This shows how to use progressbars in webtalk
mouseDoubleEvent.json
A stack which demos how the mouseDouble event messages work.
pixelColour.json
Use this example to return a pixel colour at a specified x,y location.
if-else-parentheses.json
Example showing the use of parentheses within an if else condition statement.
vscroll-clickline.json
This demo shows the use of the clickLine and the vScroll functions.
put-field-to-field.json
A validation test, more than anything. To check that putting field to field content works.
checkbox-test.json
Examples of using a checkbox, and buttons with highlights.
closestControl.json
A stack showing the use of the closestControl function.
blendLevel.json
This shows how you can adjust the blendLevel of objects.
menu.json
Example stack using dropdown menus.
roll-image.json
This stack demos the 'roll image' function.
multi-card.json
Example stack showing EXPERIMENTAL multi-card support.
soundData.json
Example stack; embedding sounds (soundData).
load-save-text.json
An example showing how you can load and save text files.

Live demos and tools:

Spin
Examples of using the spin and rotate command on graphic objects and buttons.
📄 Live demo of using the lastKeys function
This example shows you how to reference the last keys the user pressed.
📄 Bug maze demo
Live demo using a moves list field, and scripts showing how to make an object travel around a maze (with collision detection)
📄 SVG to Webtalk shape converter
An online tool to convert SVG data into shape data that webtalk recognises. (results may vary).
📄 Animate test
Live demo showing how you might do animation by swapping images into a target image object.
📄 Angle and Distance
Live demo showing how to easily return distance and angle between two objects or two points.
📄 Spaceship control
Live demo of spaceship control.
📄 Conditional if then else
Here I'm testing conditional if else statements.
📄 last object
Ways of referencing the last object created.
📄 scrollbar-rotation
Rotating scrollbars, to give you vertical ones and reverse scrollbars.
📄 export-tests
A stack demoing the use of the export image command.
📄 export-tests2
Same as the other export image command, but this time showing capture rect options.
📄 preload-sound
A stack showing how you can preload sounds, and then play, stop, pause, resume or skip within that loaded sound.
📄 preload-sound-2
Same as the other preload-sound stack, but with a few additions I thought of afterwards!
📄 continuation-character
Explanation of what the ¬ character is.
📄 fullscreen
Toggling between fullscreen with buttons.
📄 more-dates
Extra date parsing functions!
📄 Pathfind object
This demos the use of the Pathfind function in Webtalk
📄 duplicate-object
Showing the use of duplicate object script (this is actually used in the inner-workings of the IDE).
📄 Password generator
A password generator, written in webtalk
nested if statements
Examples of nested if statements.
nested if statements 2
Testing condition evaluation for nested if statements.
📄 StyledText
An example stack using the styledText for field objects.
📄 Tiny-town
An example stack showing use of arrowkeys to move a game character (suitable for an RPG-like game).
📄 Calculator
A sample calculator stack written in Webtalk.
📄 Setting an image...
Various ways of applying image data to image objects.
📄 Constants and Arrays
Numeric word constants, arrays and such...
📄 Segments and more arrays
The segment chunk type, and a few more things you can do with arrays.
📄 browserStorage
How to use browserStorage to retain information between interpreter launches, or even computer restarts.
📄 rotatedHue
Demo of using rotatedHue to adjust the hue of an image object with imageData set.
📄 asklist2
The ask list alert, but with an added optional parameter.
📄 colorNames/colourNames
Use of the colorNames/colourNames to output the list of named colours the IDE supports.
📄 mousetext
Live demo stack using the mousetext and the mousechunk commands.
📄 sort revisited
Adding more options to the sort command...
📄 kind of control
How the 'kind of control' can be used to identify object types.
📄 Groups
This demo shows the start of the group functionality. I will add more as time goes on.
📄 Text-formatting
Text editing which stacks, using span tags. Also unsetting/removing formatting. Edit the html source of the field.
Text formatting-2
Using text formatting, checking it's retained between cards, and outputting formattingCommands.
segment delimiters
Examples of using the segmentDelimiter to isolate chunks of text.
textstyle-by-range
How to style text using word x to y of field...
mouseformat
This command returns the formatted text under the mouse cursor.
mousetext
Returns the text under the mouse cursor. Also shows use of mousechunk.
paragraphs
Allows counting of number of paragraphs, and detection of the clicked paragraph (mouseParagraph).
cardnames
Returning a list of cards in a stack.
imagedata across-cards 2
Showing how to reuse imagedata between cards.
multi-card navigation
Examples of navigating between cards, using 'recent card'
tabletest
How you'd format text data and convert to a table. (Also demos the use of clickColumn).
Custom cursors
Setting custom cursors, changing hotspot (demo stack)
mouseStillDown
Using the mousedown and mouseStillDown handler, along with the idleRate property.
Shape addition and subtraction
Visual demo of using shape addition or subtraction on points of graphics.
inverseAngle
Example of how the inverseAngle can be used with collision events.
controlWithinRect
Showing how you can return a list of controls in a given rectangle.
gravity and mass
Initial tests of using the physics model for gravity, mass points, and pivot points.
fix-pos-and-rot
Test of position and rotation using fields or variables.
balloon-help
How to use balloon help in a stack, akin to tooltips.
caret-colour
Changing the flashing caret/i-beam text insertion colour
clear-text-formatting
How to clear text formatting of fields
comment
Use of block-commenting in scripts
control-click
Example of using modifier keys in scripting
full justify
How to fully justify text
handlers list
Returning a list of handlers for another object's script
lastkeys revisited
Showing another use of the lastkeys command, with lastKeysRate
letter-spacing
Example of changing letter spacing in a field.
Links
Setting links in text, changing their colours
Names of controls
Returning a named list of controls, buttons, fields, graphics, images and so on...
Property at loc
Getting the property of the control at a loc, when you don't know what the control might be.
radio buttons accent colour
Changing the colour of radio buttons and checkboxes.
text drop shadow, outer-glow
Applying drop shadows or outer glows to text fields (or spans of text)
toggle table
Toggling a field between a standard field and a table.
try-catch errors
Using deliberate errors to see if they are caught.
wordoffset and charoffset
How to use wordOffset and charOffset in script.
zoom image
How to use the 'zoom-image' command to produce temporary scaling effects.

User submissions:

Webtalk intro
Introduction demo stack, showing a few webtalk features (English version).
Webtalk intro (FR)
Introduction demo stack, showing a few webtalk features (French version).
drag chess pawn control
Dragging one item onto corresponding areas, using controlWithinObject.
drag chess pawn intersect
Same as previous, but this time each pawn chess piece uses intersect.
drag chess pawn function
Same as pawn piece with intersect, but now using a custom function in the card.
Bug maze
The bug maze features above too. It wasn't all my own work initially, although I did tweak it.
Dictionary
Not created by me, but I adapted the text list into a stack

 

Please ensure you fully refresh your browser cache between testing various versions of webtalk. Here's a great little firefox extension I use for this. In fact, once installed, refresh the page you run webtalk in a few times - I've also tried implementing a few methods of cache-blocking recently in the interpreter.