I’m running Sonoma 14.7.6 and Script Debugger 8.0.10 on a Macbook Pro 16" 2021 m1 Max 32 GB.
I am experiencing an issue when dark mode is active: the white font of the code is shown black in Finder previews.
This is the code shown in Script Debugger:
This is the same code in the preview sidebar of a Finder window when the script file is selected. You can see that only the blue code can be readen. The white code is shown in black font and it is not possible to read it:
Hitting space when the same file is selected in Finder opens the preview window with the same issue:
Hope you can fix it! Thanks!
I have more information.
This issue is only happening to the new applescripts i am creating with Script Debugger.
All the scripts created previously are not experiencing this issue.
If I create one script with AppleScript Editor, the issue doesn’t happen, even if I open it later with Script Debugger.
I wonder if this can be an issue of the new Apple Sonoma version as I updated yesterday, or maybe it’s related to a permission issue.
Any help will be highly appreciated! 
I have found what is causing the issue.
If I set the “Active Theme” to “Default Light” in Script Debugger > Preferences > Themes, there is no issue.
If I set the “Active Theme” to “Default Dark” in Script Debugger > Preferences > Themes, the issue occurs.
Is it possible that Script Debugger saves the files with a wrong color font when the Default Dark theme is active?
I suspect that’s the case. Can you try the same thing with a .scptd
file?
Same issue saving an .scptd
file
Just FYI, I also changed to the dark theme in Script Debugger few days ago, so I am not sure 100% that is a Sonoma issue.
Are you able to replicate the issue?
Yes, I can see the issue. The problem is that Script Debugger is saving the preview as it appears in a script window, but Apple’s code is now deciding to try to “fix” it somehow. I’ll see whether it can be fixed; it’s a bit tricky, because it risks breaking with older versions of the OS.
In the meantime, the best approach is probably to edit your theme to use a shade of gray rather than white for the various styles.
I tried to change the white styles for shades of gray but it is a mess because it’s the same color than comments. Also gray in dark mode is not very good for eyes.
For now I prefer to keep Script Debugger in light theme until you can fix this issue, if it’s possible,
I have tried to set all white fonts to black in a default dark theme copy. Then I have saved the scpt file. In the preview of finder all the black fonts are shown as white, so they are perfectly readable.
As far as I know, I think that the problem is that Script Debugger set with a dark theme is saving the file as a “file in light mode” and it should save the file as “file in dark mode”.
You can do these tests to see what I mean:
TEST 1: OK
- enable dark mode in macos
- set script debugger to light theme
- save a file
- the preview of finder inverts the colors and the file is readable
TEST 2: PROBLEM
- enable dark mode in macos
- set script debugger to dark theme
- save a file
- the preview of finder inverts the colors and the file is not readable
TEST 3: OK
- disable dark mode in macos
- set script debugger to light theme
- save a file
- the preview of finder doesn’t invert the colors and the file is readable
TEST 4: PROBLEM
- disable dark mode in macos
- set script debugger to dark theme
- save a file
- the preview of finder doesn’t invert the colors and the file is not readable
I guess that if Script Debugger set to a dark theme saves the files as “files in dark mode”, macos would not invert the colors in the test 2 and it would invert the colors in the test 4.
Does it makes sense for you?
I see the problem, but there’s no such thing as “files in dark mode”. We have to do something to convince the OS to not try to fix what isn’t broken. I’ll take a look – the treatment of rtf
in dark mode has been a moving target between versions of OS, and there was simply no reliable way when this code was written. Things might have changed since then.
It’s correct that Script Debugger should convince the OS to not change colors in the TEST 2 case.
But please take in mind that Script Debugger should also convince the OS to change colors in the TEST 4 case.
Hope you can find a solution! 
Thanks for your support! 
Hi @ShaneStanley
Did you find some solution? Can we expect some fix in a future release version?
Thanks!
There’s no obvious fix in sight, I’m afraid.