Understand Why a Linux Script Opens as Text Before Trying to Run It
An executable script can still open in a text editor when selected in Ubuntu Files. The executable permission and the file manager's opening behaviour are separate decisions. Repeatedly changing the default text editor will not establish whether the script is appropriate to run.
Establish what the file is
Check the source of the script and the publisher's instructions. A shell script, Python program and configuration file can all contain readable text, but they are not interchangeable. Confirm the exact filename and retain its original download or project location for reference.
Opening it as text is useful for inspection. Read the beginning and any documented configuration requirements. If you cannot determine what the program changes, ask its maintainer before executing it. Marking a file executable does not review its contents, verify its publisher or limit the changes its commands can make.
For a script you own and intend to execute, Properties, Permissions exposes the executable setting where supported. Ubuntu documents that Files may still open an executable text file in its associated application. This is not evidence that the permission setting failed.
Follow the documented launch method
Use the maintainer's command and required interpreter in the specified working directory. Check the command before pasting it and distinguish a filename placeholder from something to type literally. Administrative privileges should have a stated reason; adding sudo to every failed attempt changes the consequences without identifying the cause.
For a first run, choose the program's documented help, preview or harmless sample operation if available. Observe the output and exit behaviour before giving it production files. Keep the terminal open long enough to read an error rather than launching repeatedly from an icon.
The completion check is that the intended program performs its documented sample task under the intended account. An executable checkbox alone, an editor window, or an absence of visible output cannot provide that confirmation.
Sources: Ubuntu documentation, Ubuntu documentation.