26: IBVA Apple script

 
 

run Apple script from IBVA, select File/Run Apple Script to chose apple script file.


Run apple script file open "Script Editor".

In Script Editor, save as "File Format" -> application

makes standalone apple script application.

To run standalone apple script application doesn't open "Script Editor".



How to use apple script

/Applications/IBVA/IBVA.sdef


apple script samples

/Applications/IBVA/applescript sample


changes since IBVA V4..4.2:

rectangle -> box


also some command is not work for OSX10.5 version.

all command that work with OSX10.5 are in the

/IBVA4/applescript sample/ folder.




26.1: IBVA Suite


graphic window color, position, brain channel, sampling frequency, FFT pint, etc. can set by apple script.

currently only one target graphic window each to set.

(can not set for multiple same type graphic window)



rawwaveWindow n [inh. graphic] : A Rawwave graphic window. This abstract class represents the raw wave brain wave visualization. There are subclasses for each specific type of graphic.

elements

contained by documents.

properties

brainChannel (CH one/CH two/CH three/CH four/LeftRight one/LeftRight two/Coherence one/Coherence two/Port ON/Port OFF/Record/Play/Pause/Begin/Sampling 120/Sampling 240/Sampling 480/FFT 256/FFT 512/FFT 1024)

view (Normal View/Full View/Alpha Max/Alpha High/Alpha Mid/Alpha Low/Alpha Anime/Front View/Left View/Right View/Top View)

----------

tell application "IBVA"

    make new rawwaveWindow at end of document "script" with properties {fill color:{65535, 65535, 40}, x position:150, y position:630, width:760, height:540}

    activate

   

    tell document "script"

        set brainChannel of every rawwaveWindow to CH one

    end tell

   

end tell

----- ----------------- ----------------- ----------------- ----------------- ----------------- ----------------- ------------


bargraphWindow n [inh. graphic] : A Rawwave graphic window. This abstract class represents the raw wave brain wave visualization. There are subclasses for each specific type of graphic.

elements

contained by documents.

properties

brainChannel (CH one/CH two/CH three/CH four/LeftRight one/LeftRight two/Coherence one/Coherence two/Port ON/Port OFF/Record/Play/Pause/Begin/Sampling 120/Sampling 240/Sampling 480/FFT 256/FFT 512/FFT 1024)

view (Normal View/Full View/Alpha Max/Alpha High/Alpha Mid/Alpha Low/Alpha Anime/Front View/Left View/Right View/Top View)

----------

tell application "IBVA"

    make new bargraphWindow at end of document "script" with properties {fill color:{65535, 65535, 40}, x position:150, y position:630, width:760, height:540}

    activate

   

    tell document "script"

        set brainChannel of every bargraphWindow to CH one

    end tell

   

end tell

------ ----------------- ----------------- ----------------- ----------------- ----------------- ----------------- -----------------


waterfallWindow n [inh. graphic] : A Rawwave graphic window. This abstract class represents the raw wave brain wave visualization. There are subclasses for each specific type of graphic.

elements

contained by documents.

properties

brainChannel (CH one/CH two/CH three/CH four/LeftRight one/LeftRight two/Coherence one/Coherence two/Port ON/Port OFF/Record/Play/Pause/Begin/Sampling 120/Sampling 240/Sampling 480/FFT 256/FFT 512/FFT 1024)

view (Normal View/Full View/Alpha Max/Alpha High/Alpha Mid/Alpha Low/Alpha Anime/Front View/Left View/Right View/Top View)

----------

tell application "IBVA"

    make new waterfallWindow at end of document "script" with properties {fill color:{65535, 65535, 40}, x position:150, y position:630, width:760, height:540}

    activate

   

    tell document "script"

        set brainChannel of every waterfallWindow to CH one

    end tell

   

end tell

------ ----------------- ----------------- ----------------- ----------------- ----------------- ----------------- -----------------


waterfallBSWindow n [inh. graphic] : A Rawwave graphic window. This abstract class represents the raw wave brain wave visualization. There are subclasses for each specific type of graphic.

elements

contained by documents.

properties

brainChannel (CH one/CH two/CH three/CH four/LeftRight one/LeftRight two/Coherence one/Coherence two/Port ON/Port OFF/Record/Play/Pause/Begin/Sampling 120/Sampling 240/Sampling 480/FFT 256/FFT 512/FFT 1024)

view (Normal View/Full View/Alpha Max/Alpha High/Alpha Mid/Alpha Low/Alpha Anime/Front View/Left View/Right View/Top View)

----------

tell application "IBVA"

    make new waterfallBSWindow at end of document "script" with properties {fill color:{65535, 200, 65535}, x position:150, y position:630, width:760, height:540}

    activate

   

    tell document "script"

        set brainChannel of every waterfallBSWindow to CH two

    end tell

   

end tell

------ ----------------- ----------------- ----------------- ----------------- ----------------- ----------------- -----------------


boxn [inh. graphic] : A rectangle graphic.

elements

contained by documents.

properties

orientation (portrait/landscape/square)

brainRhythm (eye rhythm/delta rhythm/theta rhythm/alpha rhythm/beta rhythm/betaL rhythm/betaM rhythm/betaH rhythm/gamma rhythm)

responds to

rotate.


----------

tell application "IBVA" 

    tell front document

         set brainRhythm of box 1 to eye rhythm

    end tell

end tell

------ ----------------- ----------------- ----------------- ----------------- ----------------- ----------------- -----------------


26.2: Make brain swtch box


This sample script works:

open WaterfallBS window

make new brain document

make 8 box for set brain switch.


----------

tell application "IBVA"

    activate

   

    try

        close window "WaterfallBS Window"

    on error eMsg number eNum

        log {eNum, eMsg}

    end try

   

    make new waterfallBSWindow at end of document "script" with properties {fill color:{65535, 65535, 400}, x position:100, y position:80, width:690, height:540}

    tell document "script"

        set brainChannel of waterfallBSWindow 1 to CH one

    end tell

   

    make new document at beginning with properties {name:"New Brain wave"}

    delete box of document "New Brain wave"

    make new box at end of document "New Brain wave" with properties {x position:70, y position:130, width:60, height:60}

    make new box at end of document "New Brain wave" with properties {x position:80, y position:135, width:65, height:60}

    make new box at end of document "New Brain wave" with properties {x position:90, y position:140, width:70, height:60}

    make new box at end of document "New Brain wave" with properties {x position:100, y position:145, width:75, height:60}

    make new box at end of document "New Brain wave" with properties {x position:110, y position:150, width:80, height:60}

    make new box at end of document "New Brain wave" with properties {x position:120, y position:155, width:85, height:60}

    make new box at end of document "New Brain wave" with properties {x position:130, y position:160, width:90, height:60}

    make new box at end of document "New Brain wave" with properties {x position:180, y position:165, width:95, height:60}

   

end tell

------ ----------------- ----------------- ----------------- ----------------- ----------------- ----------------- -----------------



26.3: Make 8 brain rhythm box for brain switch


make 8 brain rhythm box.

In the brain note document, when select brain channel 1 and/or 2 to use, this script will run to make brain rhythm switch


----------

tell application "IBVA"

 

    tell front document

        set brainRhythm of box 1 to eye rhythm

        set brainRhythm of box 2 to delta rhythm

        set brainRhythm of box 3 to theta rhythm

        set brainRhythm of box 4 to alpha rhythm

        set brainRhythm of box 5 to betaL rhythm

        set brainRhythm of box 6 to betaM rhythm

        set brainRhythm of box 7 to betaH rhythm

        set brainRhythm of box 8 to gamma rhythm

    end tell

   

end tell

------ ----------------- ----------------- ----------------- ----------------- ----------------- ----------------- -----------------




26.4: Save IBVA docment


nice to use this for auto save data, etc.



tell application "IBVA"

    save document "Untitled"

end tell



26.5: Open IBVA docment


tell application "Finder"

    open the file "Macintosh HD:Applications:IBVA:brain data sample:AlphaBig.ibva"

end tell




---------------


©Psychic Lab Inc.

26.0: Run Apple Script