resources for Alpha resources in Tcl tex and metafont resources macintosh port of devnag personal bibliography the tools page the main page

Other scripts

  • setTypeCreator.tcl
  • sound.tcl
  • speak.tcl
  • hex2ascii.tcl
  • gestalt.tcl
  • extractAete.tcl
  • aeteToXML.tcl
  • invisibleFiles.tcl
  • fileAttributes.tcl
  • pathNameToSpec.tcl
  • swig.tcl
  • Links

    Links to other pages related to Alpha

    CVS

    AlphaTcl CVS repository on SourceForge

    Goto

    Menus

    Modes

    Features

     

    UTILITIES FOR ALPHA

    This page contains various utilitary Tcl scripts to be used with the text editor Alpha (the original AlphaTcl on Macintosh or AlphaTk on other platforms). They contain very simple procs which, I hope, will prove useful: it is always better to have them already tested and ready to use than reinvent the wheel when you need them.

    Alpha embeds a Tcl interpreter and can understand and execute the usual Tcl commands, but it also has a set of Tcl commands of its own. This implies that a script written for Alpha will not necessarily run with a standard Tcl interpreter which will not understand the commands specific to Alpha. On the other hand, the old Alpha 7 embeds the version 7.6 of Tcl: it will not understand the new syntax introduced in versions 8.0 and later of Tcl. Please check in each file for special requirements.

    Each script is a set of macros which can be used in other scripts, or bound to certain key combinations with the Bind command (Alpha's Bind command, not the bind command defined in Tk !) or copied in the main prefs file or in mode-specific prefs files in the Alpha system.

     setTypeCreator.tcl

     Description

     

    Set the type and the creator of a file.

    Procs defined in this file:

    file::setType

    set the type of a file

    file::setCreator

    set the creator of a file

    If you have to set type and creator for a large number of files, you should consider using MacMenu.

     

     Usage

        file::setType ttro "hd:Carbon:Resources:strings.r"
        file::setCreator ttxt "hd:Carbon:Resources:strings.r"

     Download

     

    setTypeCreator.tcl.sit.hqx

     

     sound.tcl

     Description

     

    Procs to select and play sound files

    Procs defined in this file:

    snd::volume

    set the volume

    snd::soundsList

    returns the list of system sounds

    snd::playSystemSound

    play a system sound

    snd::playSoundFile

    play a sound file

     

     Usage

    snd::volume 5
    snd::playSystemSound "Uh oh"
    snd::playSoundFile "HD:Beethoven:FifthSymphony"
    snd::soundsList

     Download

     

    sound.tcl.sit.hqx

     

     speak.tcl

     Description

     

    Interact with the Speech Synthesis Manager.

    Procs defined in this file:

    snd::voicesList

    returns a list of the voices available

    snd::speak

    say a text

    snd::IsSpeechSynthesis

    test if Speech Synthesis Manager is present

     

     Usage

    snd::IsSpeechSynthesis 
    snd::voicesList
    snd::speak "To be or not to be" "Bad news"

     Download

     

    speak.tcl.sit.hqx

     

     hex2ascii.tcl

     Description

     

    Convert an hexadecimal string to ascii and vice versa.

    Procs defined in this file:

    hex2ascii

    from hex to ascii

    ascii2hex

    from ascii to hex

     

     Usage

      hex2ascii 6265726e6172646f

    yields 'bernardo'

      ascii2hex bernardo

    yields '6265726e6172646f'

     

     Download

     

    hex2ascii.tcl.sit.hqx

     

     gestalt.tcl

     Description

     

    This implements the ToolBox Gestalt() function in Alpha. It returns exactly the same result (long integer) as the Gestalt() function itself and it is up to the caller to interpret the result. It is also possible to test a particular bit directly. Several examples are given in the file.

     

     Usage

    gestalt sysv
    gestalt appr 1

     Download

     

    gestalt.tcl.sit.hqx

     

     extractAete.tcl

     Description

     

    Extract human readable information from the 'aete' (Apple Event Terminology) resource of an application. With Alpha 8, the script is automatic. With Alpha 7, it is semi-automatic: since Alpha7 (in fact Tcl 7.6) cannot extract directly a resource from the resource fork, you have to do it manually. Once you have the hex data, you can run the script and get a nicely formatted, human-readable text file about the scripting terminology available in an application.

    There is also a version for Wish or Tclsh (version 8.0 or greater).

     

     Usage

     

    Please read the info in the file.

     

     Download

    Please download the script corresponding to your version of Alpha

    extractAeteAlpha7.tcl.sit.hqx for Alpha 7

    extractAeteAlpha8.tcl.sit.hqx for Alpha 8

     aeteToXML.tcl

     Description

     

    Translate the 'aete' (Apple Event Terminology) resource of an application to XML format (eXtended Markup Language). This script requires Alpha 8.

    There is also a version for Wish or Tclsh (version 8.0 or greater).

     

     Usage

     

    Please read the info in the file.

     

     Download

    Please download the script corresponding to your version of Alpha

    aeteToXmlAlpha8.tcl.sit.hqx for Alpha 8

     invisibleFiles.tcl

     Description

     

    Get a list of the invisible or visible files in a folder.

    Procs defined in this file:

    vis::listInvisibleFiles

    list only the invisible files

    vis::listFilesInFolder

    list all the files (visible and invisible)

    vis::listOnlyVisibleFiles

    just as it says...

     

     Usage

    vis::listInvisibleFiles $foldername
    vis::listFilesInFolder $foldername
    vis::listOnlyVisibleFiles $foldername

     Download

     

    invisibleFiles.tcl.sit.hqx

     

     fileAttributes.tcl

     Description

     

    Get the attributes of a file or a folder. Make a file or a folder visible or invisible. These procs rely on ToolServer which must be installed on your system. Please read the explanations in the file.

    Procs defined in this file:

    file::visibility

    set the visible/invisible flag

    file::getAttributes

    get the attributes of a file

     

     Usage

    file::visibility "HD:Alpha:Tcl:Menus:secretFile.tcl" 0
    file::getAttributes "HD:Alpha:Tcl:Menus:myMenu.tcl" actdmk -c ALFA -y4

     Download

     

    fileAttributes.tcl.sit.hqx

     

     pathNameToSpec.tcl

     Description

     

    Alpha has a built-in command called specToPathName which returns the full path name of a file from its FSSpec record. The proc pathNameToSpec defined here does just the opposite.

    Procs defined in this file:

    pathNameToSpec

     

     Usage

     
    pathNameToSpec "hd:foobar"

     Download

     

    pathNameToSpec.tcl.sit.hqx

     

    Send your comments to bdesgraupes@orange.fr

    $Date: 2006/09/04 09:17:45 $