[
    {
        "role": "user",
        "content": "I%20use%20the%20JAWS%20Screen%20Reader.%20And%20I%27m%20wondering%20if%20you%20can%20give%20me%20a%20crash%20lesson%20about%20scripting%20for%20JAWS.%20What%27s%20involved%2C%20are%20files%20mostly%20a%20type%20of%20markup%20or%20OPML%20or%20JSON%20file%20or%20syntax%3F%20Can%20you%20give%20me%20a%20breif%20example%20of%20what%20a%20script%20file%20might%20look%20like%20that%20properly%20labels%20a%20mislabled%20button."
    },
    {
        "role": "assistant",
        "content": "Here\u2019s a crash-course on scripting for JAWS, including what file types are involved, key syntax, and a worked example of how you might label a mis-labeled button. This should give you a good foundation for customizing JAWS behavior when built-in accessibility info isn\u2019t sufficient.\n\n---\n\n## What is JAWS scripting & key file types\n\nJAWS scripting allows you to customize how JAWS interacts with Windows applications\u2014how text is spoken, what gets spoken, when, and how certain controls are labeled or described. It\u2019s useful when applications are not built with good accessibility or you find something mis-labeled or missing. ([freedomscientific.com](https://www.freedomscientific.com/Content/Documents/Other/ScriptManual/03-1_JAWSScriptsAndScriptFiles.htm?utm_source=openai))\n\nHere are some of the core file types involved in scripting and configuration in JAWS: ([sastltd.zohodesk.eu](https://sastltd.zohodesk.eu/portal/en/kb/articles/jaws-common-file-types?utm_source=openai))\n\n| File extension | Purpose |\n|----------------|---------|\n| **.jss** (JAWS Script Source) | Contains readable source scripts/functions. This is where you write code to override or extend behavior. ([sastltd.zohodesk.eu](https://sastltd.zohodesk.eu/portal/en/kb/articles/jaws-common-file-types?utm_source=openai)) |\n| **.jsb** (JAWS Script Binary) | The compiled form of the .jss source, used by JAWS at runtime. You compile .jss to .jsb. ([sastltd.zohodesk.eu](https://sastltd.zohodesk.eu/portal/en/kb/articles/jaws-common-file-types?utm_source=openai)) |\n| **.jsh** (Header file) | Used for constants, global definitions, similar to headers in programming. ([support.freedomscientific.com](https://support.freedomscientific.com/content/documents/other/scriptmanual/04-1_ScriptManagerFiles.htm?utm_source=openai)) |\n| **.jsm** (Message file) | Contains spoken messages or strings used in the script\u2014helps localization and central management of what\u2019s spoken. ([sastltd.zohodesk.eu](https://sastltd.zohodesk.eu/portal/en/kb/articles/jaws-common-file-types?utm_source=openai)) |\n| **.jcf** (Configuration file) | General settings, voice profiles etc. Not strictly scripting, but part of the configuration system. ([sastltd.zohodesk.eu](https://sastltd.zohodesk.eu/portal/en/kb/articles/jaws-common-file-types?utm_source=openai)) |\n\nSo, scripting is *not* done using JSON, OPML, or markup like that. Instead it\u2019s JAWS\u2019s own scripting language (.jss files) plus associated header and message files. The syntax is particular to Freedom Scientific\u2019s JAWS language (often called \u201cJSL\u201d or \u201cJAWS scripting language\u201d). ([en.wikipedia.org](https://en.wikipedia.org/wiki/JAWS_%28screen_reader%29?utm_source=openai))\n\n---\n\n## Basic structure of a JAWS script\n\nA custom / application-specific .jss script typically includes:\n\n- Declaration of functions or handlers, often with global or constant definitions in a .jsh header file. ([support.freedomscientific.com](https://support.freedomscientific.com/content/documents/other/scriptmanual/04-1_ScriptManagerFiles.htm?utm_source=openai))  \n- Messages (spoken text) in a .jsm message file, so your script refers to names instead of hard-coding all speech. Helps with translation/localization. ([support.freedomscientific.com](https://support.freedomscientific.com/content/documents/other/scriptmanual/04-1_ScriptManagerFiles.htm?utm_source=openai))  \n- In the .jss, code that hooks into events or looks for specific windows / controls, tests properties like class names, control types, roles, then uses JAWS script commands to speak or rename labels. ([freedomscientific.com](https://www.freedomscientific.com/Content/Documents/Other/ScriptManual/03-1_JAWSScriptsAndScriptFiles.htm?utm_source=openai))  \n\nScripts can be loaded either globally (Default.jss, loaded on startup for all apps) or per-application (an .exe gets its own .jss). ([freedomscientific.com](https://www.freedomscientific.com/Content/Documents/Other/ScriptManual/03-1_JAWSScriptsAndScriptFiles.htm?utm_source=openai))\n\n---\n\n## Example: Labeling a mis-labeled button\n\nSuppose you have an application where there\u2019s a button, but JAWS just reads \u201cButton\u201d because it has no accessible name, ARIA label, or other identifyable text. You want JAWS to read \u201cSubmit Report Button\u201d instead.\n\nHere\u2019s how a simple custom script snippet in a .jss file might look. This is illustrative; exact functions / APIs depend on the version of JAWS.\n\n---\n\n```jss\n// In MyApp.jss (application-specific script for MyApp.exe)\n\n// Include the header and message file (optional but helps organize)\n#include \"MyAppDefs.jsh\"\n#include include messages \"MyAppMsgs.jsm\"\n\n// A function to label the mis-labeled button\nVoid Function LabelMisnamedButton()\n    Local VAR hwndControl\n    // Find the control by some identifier: class name, window title, control ID, etc.\n    hwndControl = FindWindowControl( \"MyAppClass\", \"##32770\", \"\", 1001 )\n    // The above is hypothetical: \"MyAppClass\" = main window class, dialog class \"##32770\", control ID 1001\n\n    If hwndControl != 0 Then\n        // Assign a name if none, or override its name\n        SayName( hwndControl, MsgButtonSubmitReport )\n    EndIf\nEndFunction\n\n// Hook this function to run when the window/dialog opens\nScript MyDialog_Open()\n    LabelMisnamedButton()\nEndScript\n```\n\n---\n\n### Accompanying header file (MyAppDefs.jsh)\n\n```jsh\n; Definitions for MyApp script\n\nConst\n    ctButtonClass = \"Button\"\nEndConst\n```\n\n---\n\n### Accompanying message file (MyAppMsgs.jsm)\n\n```jsm\nMsg MsgButtonSubmitReport = \"Submit Report Button\"\n```\n\n---\n\n## What these pieces do\n\n- `FindWindowControl(...)` locates a specific control in a window/dialog by characteristics (class, ID). If can't find, script does nothing.  \n- `SayName(hwndControl, MsgButtonSubmitReport)` tells JAWS what to read when focus lands on that control. It uses the message text from the message file.  \n- `Script MyDialog_Open()` is a \"Script\" block that ties into the dialog\u2019s open event\u2014so your labeling happens at the right moment.  \n\nDepending on version, there are functions like `SetItemText`, customizing the accessible name, or intercepting focus or inspection events. You may also use `PerformScriptByName`, etc., in more complex scenarios. ([sastltd.zohodesk.eu](https://sastltd.zohodesk.eu/portal/en/kb/articles/jaws-common-file-types?utm_source=openai))\n\n---\n\n## Tips & things to watch out for\n\n- Always test with interface and focus changes: scripts need to run when windows/dialogs open, or when control is created. Otherwise, you might miss when labeling is needed.  \n- Keep your message file clear: avoid duplicate texts, use consistent naming to make it easier to maintain.  \n- Don\u2019t conflict with existing labels: only override when necessary. If the app already provides a good name, overriding incorrectly might confuse.  \n- Save your script source (.jss), then compile to .jsb. Without the source, editing later gets harder.  \n- Be aware of admin rights / folder locations: you put scripts either in shared or user settings folder so JAWS loads them when appropriate.\n\n---\n\nIf you want, I can send you a more detailed template including several common control types (buttons, check boxes, images with no alt text, etc.), or even look up scripting reference for your version of JAWS so examples are exact. Do you want me to build that out for your version?"
    },
    {
        "role": "user",
        "content": "So%20when%20using%20JAWS%2C%20is%20there%20a%20command%20to%20add%20or%20modify%20a%20buttons%20label%20inside%20a%20standard%20Windows%20App%2C%20not%20the%20browser.%20And%20does%20this%20in%20affect%20generate%20a%20poor%20mans%20script%20for%20this%20applicatoin%20going%20forward%3F"
    },
    {
        "role": "assistant",
        "content": "Here\u2019s what I found about modifying a button\u2019s label in *standard Windows (desktop)* apps using **JAWS scripting**, and whether you can achieve something like a \u201cpoor man\u2019s script\u201d for this app going forward.\n\n---\n\n## Can you change a button\u2019s label for JAWS via scripting in a desktop app?\n\n**Short answer:** No, *not reliably*. You **cannot** directly change what the desktop app itself shows visually\u2014you\u2019re not modifying the GUI code\u2014but you **can** tell JAWS, via scripting, to *override what it speaks* for a given control. This is useful when the control is mis-labeled (or unlabeled) from an accessibility standpoint (e.g. missing text, missing accessible name).\n\nJAWS provides scripting APIs that let you locate a control (by window handle, class, ID, etc.) and tell JAWS to *speak a custom \u201cname\u201d or description* instead of whatever default it sees. But it\u2019s an override *just for the speech/output*; the visual label in the app doesn\u2019t change.  \n\nAlso note: these overrides are per-version / per-deployment\u2014if the app changes (control IDs change, layout changes), your script may break or stop working until updated.\n\n---\n\n## What commands / API-functions are available\n\nJAWS scripting offers different functions and interfaces to interact with Windows UI components. Some key relevant areas:\n\n- **FSUIA** object set (JAWS UIA Script API): This lets you access UI Automation elements in apps. You can find a control by its class, automation properties, etc. ([support.freedomscientific.com](https://support.freedomscientific.com/support/jawsdocumentation/UIAScriptAPI?utm_source=openai))  \n- There is **no function to permanently change the app\u2019s accessible name** at the source code level; scripting only overrides JAWS behavior at runtime.  \n- For Windows Forms (and many UI frameworks), properties like `AccessibleName` (and occasionally `AccessibleRole`) can be set by the application's developer. If that isn\u2019t done, JAWS often falls back to default heuristics, which can mean generic \u201cButton\u201d or \u201cPush button\u201d labels. In your script, you can mimic setting a \u201cname\u201d by telling JAWS what to say. ([learn.microsoft.com](https://learn.microsoft.com/nl-nl/dotnet/api/system.windows.forms.control.accessiblename?view=windowsdesktop-10.0&utm_source=openai))  \n\n---\n\n## Will this become a \u201cpoor man\u2019s script\u201d for the app going forward?\n\nIf by \u201cpoor man\u2019s script\u201d you mean a simplistic, maintainable script that adapts any mis-labeled button with your custom label:\n\n- **Yes, you *can* set up something basic** that works across all versions *so long as the control identifiers don\u2019t change*.  \n- But this has limits: each time the app is updated, UI layout changes, button IDs or classes change, the script might stop working and you\u2019ll need to update it.  \n- It\u2019s fragile compared with having the app itself correctly label controls via \u201cAccessibleName\u201d or via proper use of MSAA/UIA.  \n- Still, for your own use, a script override is a very pragmatic way to improve the experience.\n\n---\n\n## Example of how to override a button\u2019s label using JAWS UIA scripting\n\nHere\u2019s what such a script might look like, making use of the FSUIA API to locate a specific UI Automation element and overriding its name (speech description) for JAWS only. Note: syntax and functions may vary depending on JAWS version.\n\n```jss\n// MyAppOverrides.jss\n\n#include \"MyAppConsts.jsh\"\n#include include messages \"MyAppMsgs.jsm\"\n\n// Script that runs when windows/dialogs of this app appear\nScript MyWindow_Open()\n  Local FSUIAElement elem\n  // Locate the control using UI Automation\n  // Suppose we know the AutomationId is \"btnSave\" in the app\n  elem = FSUIA.GetElementFromHandle( 0 )  // 0 for root, or known window handle\n  // Or use a tree walk to find a child with the AutomationId\n  // This is pseudocode -- actual API may need CreateCondition, TreeWalk, etc.\n\n  If elem.Exists And FSUIA.ElementHasProperty( elem, PropertyID_AutomationId, \"btnSave\" ) Then\n    // Override the name that JAWS speaks\n    FSUIA.AnnotationPropertyString( elem.NativeWindowHandle, 0, 0,\n       PROPID_ACC_NAME, MsgSaveReportButtonName )\n  EndIf\nEndScript\n```\n\nAnd in the message file \u201cMyAppMsgs.jsm\u201d:\n\n```jsm\nMessages\n@MsgSaveReportButtonName\nSubmit Report Button\n@@\nEndMessages\n```\n\n### Notes about this example:\n\n- `FSUIA.AnnotationPropertyString(...)` is a hypothetical call\u2014typically JAWS scripting provides ways to annotate or override the \u201cName\u201d property (in the Microsoft accessibility API), telling JAWS what to speak.  \n- `PropertyID_AutomationId` etc. come from UIA definitions; in the real script, you\u2019ll build a condition like `FSUIA.CreateStringPropertyCondition(...)` and walk the UI tree to find the control.  \n- `MsgSaveReportButtonName` is pulled from your message file so you don\u2019t hardcode speech text all over the script.\n\n---\n\nIf you like, I can try to find the exact API for *your version* of JAWS (if you tell me which version you\u2019re using), and produce a script template tailored to your situation. Do you want me to do that?"
    },
    {
        "role": "user",
        "content": "So%20can%20I%20use%20JAWS%2C%20to%20identify%20let%27s%20say%20a%20mislabled%20button%20and%20transfer%20that%20UI%20Element%20designation%20to%20the%20Script%20writing%20console%3F%20Or%20is%20there%20some%20sort%20of%20IDE%20for%20JAWS%20Script%20Writing%20that%20allows%20for%20such%20interaction%2C%20and%20identificatoin%20of%20elements%20need%20relabeling%3F"
    },
    {
        "role": "assistant",
        "content": "That\u2019s a great question. The tools around JAWS and Windows have some capabilities for identifying mis-labeled UI elements\u2014but there isn\u2019t exactly a built-in IDE that automatically transfers info into the scripting console. Below is what *is possible*, what *isn\u2019t*, and some workarounds that come close.\n\n---\n\n## What tools exist to inspect UI elements for desktop apps\n\nTo label or override speech correctly, you need to know the properties of UI elements (names, roles, IDs, etc.). Here are tools you *can* use:\n\n- **Inspect (Inspect.exe)** \u2014 part of Microsoft\u2019s Windows SDK. Lets you hover/select elements in any running app (desktop application), then see their accessibility info: UI Automation (UIA) properties, MSAA properties like \u201cName\u201d, \u201cRole\u201d, control type, AutomationId, etc. ([learn.microsoft.com](https://learn.microsoft.com/hr-hr/windows/win32/winauto/inspect-objects?utm_source=openai))  \n- **Accessibility Insights for Windows** \u2014 more modern; helps you explore and validate accessibility in desktop apps, view the accessibility tree, see missing name/role, etc. (though it doesn\u2019t directly generate JAWS scripts) ([reddit.com](https://www.reddit.com/r/accessibility/comments/1pbpiyv/testing_desktop_apps/?utm_source=openai))  \n- **JAWS Inspect** \u2014 primarily for web pages, helping see how JAWS reads web elements. Not focused on native desktop apps. ([tpgi.com](https://www.tpgi.com/wp-content/uploads/JAWS-Inspect-Quick-Start-Guide.pdf?utm_source=openai))  \n\nThese tools help with *identification*\u2014seeing what JAWS (or the UI Automation layer) sees for each control.\n\n---\n\n## Is there an IDE / script-console in JAWS that connects this inspection to script writing?\n\nFrom what I found:\n\n- JAWS does **not** have a fully integrated IDE (like Visual Studio for desktop apps) that let you click on a button in a live app, auto-generate script code to override its label, and drop that into a script file automatically.\n- There is the **Fusion Suite Developer Network (FSDN)** and the JAWS scripting reference manual, which tell you what script functions exist, how to use them, and the syntax. It\u2019s useful for writing scripts once you know what control you want to override. ([support.freedomscientific.com](https://support.freedomscientific.com/support/jawsdocumentation/FSDN?utm_source=openai))  \n- Some script authoring tools (or scripts people share) can make this semi-easier, but they still require you to manually gather the control identifiers (AutomationId, window class, control ID or class name) using tools like Inspect, and then write code referencing those identifiers in .jss.  \n\nSo, you *can* use Inspect (or Accessibility Insights) to identify mis-labeled buttons, then manually write the script code using the identifiers you find. But there\u2019s no automatic \u201ctake this control and inject it into script\u201d UI in standard JAWS for Windows (as of what I found).\n\n---\n\n## Possible workaround / \u201cpoor man\u2019s link\u201d between these tools and script writing\n\nSince direct automatic transfer isn\u2019t standard, here\u2019s how you can piece a workflow together:\n\n1. Use Inspect.exe (or Accessibility Insights) to select the control. Hover or keyboard focus to highlight it; capture its properties:  \n   - Name (if any)  \n   - AutomationId (if there is one)  \n   - Class name  \n   - Control type (button, push button, etc.)  \n   - Parent dialog / window title or window class or window handle (HWND)  \n\n2. Write a small snippet in your .jss script that targets that control\u2014matching by one or more of those identifiers. For example:\n\n   ```jss\n   // in MyApp.jss\n\n   Void Function OverrideButtonLabel()\n     Local VAR hwnd, element\n     hwnd = FindWindowByClass( \"MyAppWindowClass\", \"MyApp.exe\" )\n     If hwnd != 0 Then\n       element = FindWindowControl( hwnd, \"Button\", \"\", 105 )  // using class \"Button\", control ID 105\n       If element != 0 Then\n         SayName( element, MsgMyCustomName )\n       EndIf\n     EndIf\n   EndFunction\n\n   Script MyAppWindow_Open()\n     OverrideButtonLabel()\n   EndScript\n   ```\n\n3. Store your override speech in `.jsm` (messages) file:\n\n   ```jsm\n   Messages\n   @MsgMyCustomName\n   Submit Report Button\n   @@\n   EndMessages\n   ```\n\n4. Compile script to `.jsb` and test with JAWS. If application update changes identifiers, revisit step 1 with Inspect to discover new identifiers, and update script.\n\n---\n\n## Summary\n\n- Yes \u2014 you *can* identify mis-labeled buttons using tools like *Inspect.exe* or *Accessibility Insights*. These show the properties needed for scripting.\n- No \u2014 there is *no native JAWS IDE* that lets you click a UI element in a desktop app and automatically generate script code to relabel it.\n- You\u2019ll need to take what you find (ids, control type, window class/title), then write a script snippet referencing those identifiers, as shown above.\n- This procedure can become your \u201cpoor man\u2019s script approach\u201d\u2014once you\u2019re used to it, you can maintain script files for your app, respond to changes, and improve how JAWS speaks elements.\n\nIf you tell me what version of JAWS you have, and perhaps what UI framework the app uses (Win32, .NET WinForms, WPF, etc.), I can show you a more specific template or workflow tailored to your case. Want me to do that?"
    },
    {
        "role": "user",
        "content": "Why%20the%20heck%20does%20a%20.jsb%20binary%20file%20exist%2C%20seems%20like%20a%20old%20programming%20idea%20to%20excelerate%20speed%20of%20processing%2C%20but%20a%20security%20and%20stability%20nightmare%20now.%20Are%20there%20any%20comparisions%20you%20can%20draw%20that%20use%20to%20operate%20this%20way%20perahps%20JAVA%20applets%3F"
    },
    {
        "role": "assistant",
        "content": "You\u2019re absolutely right: using `.jsb` (JAWS Script Binary) files *does* feel like something from an earlier computing era\u2014compiled scripts for speed. And as with many \u201cold\u2010school\u201d approaches, there are trade\u2010offs: speed vs. security, maintainability, transparency. Below are what I found on *why* Freedom Scientific uses `.jsb`, what trade\u2010offs exist, and how that compares to other systems like Java bytecode / applets.\n\n---\n\n## What is a `.jsb` file\n\n- The `.jsb` is the *binary* compiled version of JAWS scripts (`.jss` source files). The `.jss` are human-readable source files; `.jsb` is what\u2019s loaded by JAWS at run time after compilation. ([sastltd.zohodesk.eu](https://sastltd.zohodesk.eu/portal/en/kb/articles/jaws-common-file-types?utm_source=openai))  \n- The advantage is fast load and execution\u2014precompiled scripts parse and load more quickly than parsing text source each time. Also, language overhead is reduced. That is, for performance\u2010sensitive apps, the startup delay or script parsing overhead matters.  \n\n---\n\n## Why it can be a security / stability risk\n\nCompiled binary script files bring the classical risks of any binary artifact:\n\n- **Opaque**: You can\u2019t read `.jsb` directly to see what the script does. If someone distributed or shared a `.jsb` without the `.jss` source, it could conceal malicious or unsafe behavior.  \n- **Tampering / malware**: If an attacker can replace or inject a malicious `.jsb` file (with higher privileges or access), then when JAWS loads it, it could execute undesirable functions\u2014relabeling, triggering unwanted speech, or even worse if the scripting API allows dangerous OS calls (depending on script permissions).  \n- **Corruption**: Binary files may be corrupted in transit, by disk failures, or by version mismatches. If the `.jsb` is out of sync with what `jss` version it was compiled from, debugging becomes very hard.  \n- **Versioning / compatibility**: When JAWS or the underlying APIs change, old `.jsb` binaries may break or behave unexpectedly. Without source, fixing is difficult.  \n\n---\n\n## Why vendors still use binaries like `.jsb`\n\n- **Performance**: Faster load, less parsing overhead. In older computers, this was more significant. Even today, scripts loaded early can affect perceived performance.  \n- **Protection of intellectual property**: Vendors might not want all script source visible; binary forms obscure source.  \n- **Simplified deployment**: Script authors ship a `.jsb` that works immediately without requiring script compilation in the target environment.  \n\n---\n\n## Java bytecode / applets as a comparison\n\nJava\u2019s `.class` files (bytecode) are conceptually similar to `.jsb`:\n\n- `.class` files are compiled from `.java` source. The bytecode is platform-independent and loaded via the JVM.  \n- Bytecode can be decompiled (though imperfectly) just like `.jsb` can\u2019t be easily read in full \u2013 both are opaque.  \n- Java applets or sandboxed Java code had strong security models: bytecode would be verified, restricted by classloader permissions, security manager, etc. This helped minimize damage from untrusted code. ([docs.oracle.com](https://docs.oracle.com/en/database/oracle/tuxedo/22/otxjo/java-applications-java-applets.html?utm_source=openai))  \n\nSo `.jsb` is like \u201cJAWS bytecode\u201d: scripts compiled, then loaded & executed by JAWS at runtime. But one difference is that **JAWS scripts typically run on the same privilege level as JAWS**, which is high (runs all the accessibility and UI hooking), so malicious or buggy `.jsb` could have bigger side effects.\n\n---\n\n## Are there safer/modern alternatives?\n\nGiven modern security practices, some more secure/transparent alternatives include:\n\n1. **Signed/verified binary scripts**: If `.jsb` files are signed by Freedom Scientific (or admins), then JAWS could verify signatures before loading. Does JAWS currently do this? I found *no evidence* that `.jsb` are signed or verified in current JAWS versions; I didn\u2019t locate that in public docs.  \n2. **Loading only script source (.jss)** in trusted environments: Skip binaries, load human-readable scripts at runtime. Slower, but easier to inspect and audit.  \n3. **Sandboxing script operations**: Limit what script APIs can do\u2014restrict them from performing dangerous system calls, or interacting with unauthorized apps. I didn\u2019t find a documented sandbox model for JAWS scripting language; seems scripts are trusted.  \n4. **Auditable scripting tools / script IDEs**: If script authors keep version control, full source code in `.jss`, documentation, and compile into `.jsb` only for release; users/admins can inspect source.  \n\n---\n\n## Why it feels like a relic\u2014and whether it still makes sense\n\n- Early computing had weaker hardware; parsing scripts at runtime for every startup or UI event could be costly. So binary/compiled script archives made sense.  \n- Now with modern hardware, much of that performance penalty is smaller; more focus is on maintainability, security, transparency.  \n- Also, users care more about *what the script is doing*, not just that it has fast response.  \n\nSo yes, `.jsb` is kind of a holdover from older performance/technology constraints. It still has some performance benefits, but those benefits are less compelling in many modern setups.\n\n---\n\nIf you like, I could try to dig and see if Freedom Scientific has any roadmap for improving the `.jsb` system\u2014e.g. adding signature checking, better audit tools, or shifting away from binary-only distributions. Do you want me to take a look?"
    }
]