Friday, November 16, 2018

#1 2018-11-10 09:55:14 am

Riku
Member
Registered: 2016-05-23
Posts: 36

Stop AppleScript apps being referred to by incorrect names?

Time to take the bull by the horns: How do I fix this and stop it from happening in the future?


AppleScripts using UI scripting:
When I have to give them access to use the UI, OR when I have some dialogs coming from AppleScript apps being logged to the notification center, why do some AppleScript apps have their names on those lists displaying correctly but some turn into a long randomly generated hash of capital letters and numbers? I think I've been saving them the same way and I just can't figure out where that name is stored and where that hash randomly comes from.

• Selecting such app in Finder and pressing the space bar: name displays correctly (I know sometimes you find residue of old names this way if you've created a new script based on an old one and renamed it later)
• Inside the package at Contents, I checked on Info.plist and don't see references of the weird name (I suppose that info is the same you would see in the Bundle info view if in Script Editor)


The hash names are also too long to be fully displayed in the UI scripting access window, so whenever I edit or upgrade my script app and have to re-enable UI access for it, I basically can't tell which one of the hash named apps it is so I have to untick and tick all of those with a weird name so it'll be one of them.

I noticed another thing:
If I remove a script from a given folder completely, copy-paste its contents into a new script and save that as a completely new fresh app, the moment I save it, the name in the script window's top center changes to display a very old name of a version way, way back, in a form that contains a dash instead of a space (like I would've named it); The dash making the form look like the type of name I see in the Bundle Info tab, Identifier box. But where on earth does it pull those old names from, even for a freshly saved app?

Offline

 

#2 2018-11-10 08:09:13 pm

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 5470

Re: Stop AppleScript apps being referred to by incorrect names?

It's possible you have a corrupt Launch Services database. A Goggle search will show you haw to rebuild it. It's also possible you have an issue with your AppleScript preferences, in which case running this script should help:

Applescript:

use framework "Foundation"

set scriptDefaults to (current application's NSUserDefaults's alloc()'s initWithSuiteName:"com.apple.applescript")
scriptDefaults's removeObjectForKey:"ApplicationMap"


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/
latenightsw.com

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)