• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
javascript - applescript // bear with me !
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

javascript - applescript // bear with me !


  • Subject: javascript - applescript // bear with me !
  • From: Christian Vinaa <email@hidden>
  • Date: Fri, 25 Mar 2005 14:22:53 +0100

on the net I found this rather spiffy little java-script:


<script type="text/javascript"> // This script courtesy of Uncle Jim // www.jdstiles.com var nav=navigator.appName; var ns=(nav.indexOf("Netscape")!=-1);

if(ns){
if(document.layers){
document.captureEvents(Event.KEYPRESS);
document.onkeypress = cheat;
}
if(document.getElementById){
document.onkeypress = cheat;
}
}
else
{document.onkeypress = cheat;}

var SpecialWord = "hello";
var SpecialLetter = 0;
var vcheat = false
function cheat(keyStroke)
{
 var eventChooser = (ns)?keyStroke.which: event.keyCode;
 var which = String.fromCharCode(eventChooser).toLowerCase();
 if(which == SpecialWord.charAt(SpecialLetter)){
   SpecialLetter++;
   if (SpecialLetter == SpecialWord.length) {
 window.location="new-page.html";
}
}
else {SpecialLetter = 0;vcheat = false}

}
</script>


it is actually quite funny

you put the script in a HTML page  ( head section )  and then
whenever you  type  the   SpecialWord
which in fact can be a whole sentence  or whatever

the     new-page.html     is loaded



this got me to think;

shouldnt it be possible to do that in applescript too ?


i just feel that there might be some un-chartered posibilities here

havent thought them through, though  ;-)

/ Christian
--
Christian Vinaa

...... Meanwhile, aunt Martha, having taken a tramp in the woods,
is lying in a ditch at the edge of town .........................
--
Christian Vinaa

...... Meanwhile, aunt Martha, having taken a tramp in the woods,
is lying in a ditch at the edge of town .........................
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: Reduce multiple characters to single occurrence (via do shell script?)
  • Next by Date: Re: getting chunks of text
  • Previous by thread: Re: Reduce multiple characters to single occurrence (via do shell script?)
  • Next by thread: Word wordcounts
  • Index(es):
    • Date
    • Thread