Script Editor's custom formatting preferences issue
Script Editor's custom formatting preferences issue
- Subject: Script Editor's custom formatting preferences issue
- From: ILJA SHEBALIN <email@hidden>
- Date: Thu, 20 Jul 2017 00:55:26 +0300
Hello,
I think it's long overdue to talk about a bed upon which all the scripting wisdom rests - ScriptEditor. I'm dealing with the issue for a half a year, that is, it doesn't keep custom preferences for fonts and color I set up to appear when compiling the code. Whenever I select a new app in the situation when compiling a script for an unidentified app invokes a prompt to choose the app from the window containing the list of all available applications and relaunch Script Editor after doing changes all my preferences get reset. I learned that this is an old bug that passed Apple's scrutiny unaddressed. As a workaround an Apple Support Communities user red-menace provided the solution when running his script together with installing a launch agent that watches Script Editor's plist with effective custom preferences and upon any undesired changes such as mentioned above resets it to the customized version by writing the contents of a back up copy of the plist (with these custom preferences) created in advance in the same directory (~/Library/Preferences) to the affected original plist. The first time I installed this agent I noticed no change in the behavior but I then loaded it manually with "launchctl load" in Terminal and it seems it worked the next time when I created the situation when it prompted me to select an app to add to the Library. Or maybe it was an illusion but ironically it generated a message in Console telling smth like "unable to write changes" (not exact wording). I then checked in Activity Monitor the files and ports opened by launchd process and the AppleScript Editor's plist was (and still is) among them. Unfortunately it no longer worked for me later in identical situations so I'm forced to run the AppleScript script manually every time to revert to the customized version. I don't know how to make it effect undesired changes without involvement on my part as it seems the launch agent does its job but leaves it unfinished. Here I attach a ZIP archive with AppleScript script file that installs and creates the launch agent and the AppleScript .scpt (2 versions). Since I'm on Lion that doesn't have AppleScript-ObjC environment I ran ReformatterSetup.scpt, however if you're on newer version you may find that ReformatterSetup-1.scpt fits your system best. I put both versions just in case. All credits go to red-menace. Note: since the default language of my system is Russian and the AppleScript script includes shell commands you need to edit .scpt file in the part containing the name of the copied plist to comply with language syntax conventions of your system that generates default names of any copied object in Finder - in English version it's "com.apple.applescript copy", in Russian system it's "Копия com.apple.applescript". You should make any changes to default preferences in Formatting pane of AppleScript Editor Preferences first, quit AppleScript Editor and then create a copy of the AppleScript Editor's plist in the same directory. Running ReformatterSetup.scpt installs launch agent in ~/Library/LaunchAgents as well as ScriptReformatter.scpt in the folder launchd created in ~/Library/Scripts.
|
Attachment:
Install_scripts.zip
Description: Zip archive
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden