Skip navigation.
 
mlRe: NSAppleScript no longer allows user interaction?
FROM : Renaud Boisjoly
DATE : Mon Aug 14 20:34:45 2006

Thanks for the idea Matt, but in this case, I'm not sure what the 
target app would be... my app runs in the background and launches 
AppleScripts stored in files when certain events occur. And I'm not 
sure why this is happening. Before a script like:

display dialog "Something happened" buttons {"Ok"} default button 1

would work... but now, I need to use "tell" to an application for 
this to work. I could tell the Finder to activate then send the 
message, but this means the Finder will always be in front when this 
script runs, and all current scripts have to be modified to activate 
the Finder before displaying a dialog, but for some scripts, this 
might not be appropriate.

I'm wondering if something has changed or if there is some parameter 
I can use to allow these scripts to run and interact with users.

- arby

Le 06-08-14 à 13:49, Matt Neuburg a écrit :

>> Hi all
>>
>> I've been using NSAppleScript's executeAndReturnError method to run
>> various scripts from within my app. It has been working for years and
>> now, it seems broken on my MacBook Pro.
>>
>> As I try to migrate to a Universal code base, it seems that I can no
>> longer run scripts which try to interact with the user. If I do, I
>> get a "No user interaction allowed" error.
>>
>> I'm just trying to have a script use the "Display Dialog" command to
>> let the user know of something. It used to work, but now it doesn't.
>> If I modify the AppleScript to talk to a specific app, it works, but
>> that app's icon bounces in the Dock to let me know. Not fun... not
>> what I'd like to happen and not what used to happen.

>
> Tell the target app to activate before telling it to display 
> dialog. m.

Related mailsAuthorDate
mlNSAppleScript no longer allows user interaction? Renaud Boisjoly Aug 14, 16:49
mlRe: NSAppleScript no longer allows user interaction? Matt Neuburg Aug 14, 19:49
mlRe: NSAppleScript no longer allows user interaction? Renaud Boisjoly Aug 14, 20:34
mlRe: NSAppleScript no longer allows user interaction? Stephen Deken Aug 14, 22:09
mlRe: NSAppleScript no longer allows user interaction? Matt Neuburg Aug 14, 23:02