TextEdit issues on an Intel Mac

With an Intel-based MacBook Pro and OS 12.0.1 and Panorama 10.2.0.b24, the following code creates a file that won’t open with TextEdit. The identical code run on an M1 Mac mini will work properly and open the new file with TextEdit.

let lvmessage=“Hello WORLD.”
Filesave “~/Desktop/testfile.txt”,lvmessage
openanything “~/Desktop/testfile.txt”

Try delaying the openanything statement for a few seconds or put it in another procedure. I suspect that you’re trying to open the file before Panorama X has had a chance to finalise its creation.

Tom, have you checked that TextEdit is the preferred application to open .txt files on your MacBook? You can check that with a right-click on a .txt file > Open with … or directly in the .txt files’ Informations window, where you can set the standard application.

On the Intel Mac, the file will not open with TextEdit even if I right click on it and select Text Edit. I can open the file with BBEdit. Nor will it open with Pages, but it will open with MS Word.
In other words, there is something strange about the file so that it is malfunctioning.

In response to Michael’s suggestion, I inserted a wait 0 before the openanything, but that did not help. I also used openwith “TextEdit”,…, and that did not help.

There is something strange about TextEdit on your machine. TextEdit will open anything, and interpret it as text. I just used it to open a PDF. Since it isn’t actually text, it just looks like gibberish, but it does open.

Try saving a file with BBEdit, and opening it with TextEdit. Does that work? Can TextEdit open a file it created itself, and saved as text, (not rich text)?

1 Like

On an M1 MacBook running 12.0.1, I copied your procedure and ran it on the very same Pan version as you’ve noted. Worked like a charm and opened in TextEdit without any delay being involved.

On a Mini with an Intel processor running 12.0.1, it also ran just fine.

Have you changed the default application to open .txt files on the Intel Mac? You can do that with Get Info in the Finder, so you may have a corrupt Finder preference.

For no known reason, my procedure starting working and the .txt documents opened with TextEdit without a problem. Thanks to everyone for the various suggestions on troubleshooting the problem.