Bug/Enhancement: Trim application extension in "tell process" statement

,

Script Debugger has a useful feature. When you create a tell application group of statements (e.g. drag an application name from the Inspector to the script text area), the entire name of the application is entered. For example, dragging System Events results in: tell application “System Events.app”. Upon compiling, Script Debugger very nicely removes the .app extension, as it should not be present.

However, if you manually change “application” to “process” in that tell statement and compile, Script Debugger does not trim off the extension, resulting in an error when the script is run.

It would be convenient if Script Debugger did so.

Mac Pro (late 2019)
macOS 11.2.3
Script Debugger 8A27

I’m not sure where you’re seeing this .app, however a process’s name is not necessarily the same as its application name, so just changing application to process is not a reliable thing to do.

Well, as I described, it is included with the application’s name in the tell statement created by dragging an app from the Inspector to the script text area. See the first screenshot. After compiling, the .app is removed. See the second screenshot.

It turns out that the .app extension is not always included. For example, Finder.

I have created a “tell process” clipping which does most of what I would like.

For the applications with which I work, the process name is the same as the application name, so that is not an issue for me.


If you work with a common list of apps, something like this (modified with your app names) should do the trick:

tell process "[[template:custompicker:Choose process:System Events:Finder:Mail]]"
[[selected-lines]]
end tell

Shane - thanks for a clever idea.