[
    {
        "role": "user",
        "content": "I%27d%20like%20to%20write%20a%20JAWS%20(screen%20reader)%20script%20.jss%20to%20delay%20500%20ms%20and%20then%20pass%20the%20key%20that%20triggered%20it%20to%20SayLineDown"
    },
    {
        "role": "assistant",
        "content": "Here\u2019s how you can write a JAWS `.jss` \u201cpass-through\u201d script that delays ~500 ms (i.e. 5 tenths of a second), then invokes `SayLineDown` for the key you pressed. Unfortunately, JAWS doesn't directly provide a generic \u201cPass through ANY key, then say line-down\u201d hook, so you\u2019ll need to bind this behavior to specific keys. Below is a template you can adapt. I\u2019ll explain after how it works and what limitations you may hit.\n\n---\n\n## Example script (in `.jss`)\n\n```jss\nScript SayLineDownAfterDelayFor_DownArrow ()\n    // Declare local variables\n    Var\n        String sKeystroke\n\n    // Store the keystroke you want to trigger this with\n    Let sKeystroke = \"DownArrow\"\n\n    // Delay in tenths of a second \u2192 5 tenths = 500 ms\n    Delay (5)\n\n    // Pass the original keystroke through so normal behavior still happens\n    TypeKey (sKeystroke)\n\n    // And then say the content of the line below the cursor\n    SayLineDown ()\n\nEndScript\n\n// Now bind this script to the same key (DownArrow)\n// This must be done via the Script Manager: assign DownArrow to SayLineDownAfterDelayFor_DownArrow\n```\n\n---\n\n## Explanation & Key Functions\n\n- **Script name**: Any unique name you choose; above it's `SayLineDownAfterDelayFor_DownArrow`.\n- **Var**: declares local variables (e.g., `sKeystroke`) to store the key name.  \n- **Let sKeystroke = \"DownArrow\"**: sets the name of the key you\u2019re binding. You\u2019ll use it later in `TypeKey`.\n- **Delay (5)**: pauses script execution for 5 tenths of a second (i.e. 500 ms). ([support.freedomscientific.com](https://support.freedomscientific.com/Content/Documents/Other/ScriptManual/10-3_DelayingYourScript.htm?utm_source=openai))\n- **TypeKey (sKeystroke)**: sends the original key through to the application so its built-in behavior (moving down a line) still happens. This makes the script \u201cpass-through\u201d. ([support.freedomscientific.com](https://support.freedomscientific.com/Content/Documents/Other/ScriptManual/10-1_PassThroughScripts.htm?utm_source=openai))\n- **SayLineDown ()**: after passing the key, speaks the line below the current cursor/row. If you want to move down then say that line, this accomplishes it.\n\n---\n\n## Limitations & Considerations\n\n1. **Must bind for each key**: This script only works for a specific key you bind it to (e.g. \u201cDownArrow\u201d). If you want the same behavior for \u201cUpArrow\u201d or other keys, you\u2019ll need separate scripts for each.\n\n2. **Timing sensitivity**: The `Delay` function uses tenths of seconds. Delay (5) = 500 ms. On fast machines, that may feel laggy; on slow ones, the application might already have processed things, making the delay unnecessary or too long. Testing is key. ([support.freedomscientific.com](https://support.freedomscientific.com/Content/Documents/Other/ScriptManual/10-3_DelayingYourScript.htm?utm_source=openai))\n\n3. **Focus & cursor types**: Behavior might vary depending on whether the JAWS cursor, invisible cursor, or PC cursor is active in the application. `SayLineDown` may produce different output depending on what\u2019s under focus. Movement and speech functions are context sensitive. ([support.freedomscientific.com](https://support.freedomscientific.com/Content/Documents/Other/ScriptManual/06-6_MovingTheCursor.htm?utm_source=openai))\n\n4. **Passing events & losing default behavior**: If you forget `TypeKey(...)`, then the normal \u201cDown\u201d key behavior might be lost (or overwritten) for that application or script file. The \u201cpass-through\u201d pattern is essential. ([support.freedomscientific.com](https://support.freedomscientific.com/Content/Documents/Other/ScriptManual/10-0_PassingKeystrokesAndTypingTextWithScripts.htm?utm_source=openai))\n\n5. **Events suppression**: `Delay` optionally accepts a second parameter `nNoEvents` (TRUE or FALSE) to suppress processing of `FocusChangedEvent` or `NewTextEvent` during the delay. If your script misbehaves (you hear or don\u2019t hear extra speech), you may need to use that. ([support.freedomscientific.com](https://support.freedomscientific.com/Content/Documents/Other/ScriptManual/10-3_DelayingYourScript.htm?utm_source=openai))\n\n---\n\n## How to set up in JAWS\n\n1. Open **Script Manager** (INSERT+F2 \u2192 Script Manager).\n2. Choose **Default** script file or application-specific .jss file (depending on whether you want this globally or just in a particular app).\n3. Create a new script, give it a name (`SayLineDownAfterDelayFor_DownArrow` or whatever).\n4. Check \u201cAttach to Key\u201d, and when prompted, press the key you want (in this example, press the Down Arrow).\n5. Save/compile the script.\n\n---\n\nIf you want, I can also show you a version that works for *multiple keys* (for example Up, Down, Left, Right) in one script, using parameterization or separate handlers, so it\u2019s more DRY. Would you like that?"
    }
]