Re: [NTLK] Dashboard Scripts

From: Ed Kummel (tech_ed_at_yahoo.com)
Date: Mon Nov 17 2003 - 13:41:59 PST


I was going to email these directly to David, but I
remembered that there were others asking for this
stuff in the past, so I figure...it's On Topic, so why
not...
I have 5 scripts that I use regularly on this Newt. I
have more on my other Newt, but it's currently not
functioning, so it may be a while till I get the
scripts off of it.
Each script begins AFTER the "==============" stuff
and the first line is commented with what the script
does. Be wary about line wrapping...

Script 1
==============
//SpeakTime
local thevolume:=getvolume();
local t := HourMinute(Time());
local d := LongDateStr(Time(), @66 .abbrDateStrSpec);
local u := "The [[emph +]]time is ";
local theLen := StrLen(t);
local tt := t;
if StrPos(t, "am", 0) then local tt := SubStr(t, 0,
theLen-1)&".m"; local vox := "[[svox fred;rate 150]]";
Setvolume(4); PlaySound(vox&u&"[[rate 75]]"&tt);
Setvolume(thevolume);

Script 2
================
//List of all packages on your Newt
local noteString :=
"// The following is a list of
// the package names of all
// packages installed on this
// Newton device as of
// " & DateNTime(time()) & ".
//
//It is useful for creating
// customized versions of the
// Freeze/Thaw Group script
// from Five Speed Software.
//
// See the web page at
//http://www.fivespeed.com/dashboard scripting
<http://www.fivespeed.com/dashboard/scripting>
// for more information.
";
ShowBusyBox(true);
foreach i in GetStores() do
begin
foreach pName in GetPackageNames(i) do
begin
noteString := noteString & pName & ",\n";
end;
end;
GetRoot().paperroll:MakeTextNote(noteString, TRUE);

Script 3
=========================
//displays heap statistics
func(NullVariable)

begin
local theHeap;
GC();
theHeap:="Heap size: " & Stats() & " bytes";

//return theHeap;
        :Notify(3, "Current heap is;", theHeap);
end

Script 4
===============================
//speak selected text
//use fred or ralf or gnws or zarv etc. kath
//to select which voice to speak in
local t := GetHilitedTextItems();
local vox :="[[svox ralf]]"; // changes voice to Kathy
if not (t=nil) then
     begin
     foreach item in t do
     PlaySound(vox&item);
end;
else
begin
PlaySound("You must select something first.");
end;

Script 5
===================================
//speak selected text 2
// From David Abramowitz (underdog_at_erols.com)
// from a script originally from Stephanie
local t = GetHilitedTextItems();
if t <> nil
     then
for each item in t do PlaySound(item);
     else
begin
     PlaySound("Duh, select some text first.");
end;

Ed
web/gadget guru

--- David Mills <solidsilver_at_ntlworld.com> wrote:
> Has anyone got any useful dashboards scripts to
> share? Seeing as I am
> useless at that type of thing I wonder if there was
> any possibility of
> borrowing some?
> Dave

=====
"When any government, or church for that matter, undertakes to say to its subjects, 'This you may not read, this you must not see, this you are forbidden to know', the end result is tyranny and oppression , no matter how holy the motives"
     -Robert Heinlein, Revolt in 2100

__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

-- 
This is the NewtonTalk list - http://www.newtontalk.net/ for all inquiries
List FAQ/Etiquette/Terms: http://www.newtontalk.net/faq.html
Official Newton FAQ: http://www.chuma.org/newton/faq/


This archive was generated by hypermail 2.1.5 : Tue Nov 18 2003 - 00:00:01 PST