Re: "Where is application ...?" dialog stopping automation
Re: "Where is application ...?" dialog stopping automation
- Subject: Re: "Where is application ...?" dialog stopping automation
- From: Paul Berkowitz <email@hidden>
- Date: Fri, 21 Jan 2005 09:03:46 -0800
Hi, David
Unless you hear otherwise from someone like Chris Nebel, I think you might
have to work around this problem. I have no experience with post-Security
Update 06-07-2004 issues specifically, but I have dealt with similar issues
before. If the "Where is app ?"dialog comes up as the AppleScript is trying
to compile it, you might be able to get around this by writing all your
scripts using variables for the application names. You'd do this every time
you had to script Word, for example:
using terms from application "Microsoft Word"
tell application wordAppPath
--script here
end tell
end using terms from
That would allow you to write and compile the scripts in the first place.
At the beginning of the script, you'd put the file path for the location
where you'll always be putting your test builds of the app (or re-set it if
you move or re-name the location), e.g.:
set wordAppPath to (path to applications folder as Unicode text) & "Test
App Folder:Microsoft Word"
When you give AppleScript the full path to an application in a 'tell
application appPath' statement, it usually doesn't ask you where the app is.
I haven't quite understand at what point exactly you object to opening the
app, but if you _can_ allow it to open first before proceeding, then asking
the Finder to open it will often get around other "Where is?" problems:
set wordAppPath to (path to applications folder as Unicode text) & "Test
App Folder:Microsoft Word"
tell application "Finder" to open alias wordAppPath
using terms from application "Microsoft Word"
tell application wordAppPath
--script here
end tell
end using terms from
--
Paul Berkowitz
> From: David Weiss <email@hidden>
> Date: Wed, 19 Jan 2005 12:20:48 -0800
> To: Applescript Users List <email@hidden>
> Subject: Re: "Where is application ...?" dialog stopping automation
>
> More information about this problem:
>
> The Goal:
> To programmatically register the applications so we do not have to
> launch them prior to running our test scripts. We do not want to
> launch them before we start the tests because that invalidates the
> first run state of our applications.
>
> More Details:
> This may have to do with the security features from Security Update of
> 06-07-2004. It appears there is this idea of ³trusted² applications -
> ones that are not only registered with Launch Services, but have been
> run before. My guess is that the compiled AppleScript libraries are
> trying to access the dictionaries of applications that are NOT trusted
> yet, and are prompted with the ³where is application foo² dialog.
>
> The question for Apple is how to ³register² an application as trusted?
> So the compiled AppleScript libraries will not have to ask for
> references to the applications.
>
> The following comes from one of the Apple Discussion lists:
>
> ³Please note that after the Security Update of 06-07-2004,
> LSFindApplicationForInfo will not find applications which have never
> been launched before. In a development environment, this can happen
> more often than you would like because you're rebuilding the app
> frequently, so it each time it may look like a new app to LS (depending
> on how it's rebuilt). The LSRegister calls do not cause an application
> to become, as we say, "trusted". LSRegister does allow an "untrusted"
> app's document icons and kind strings to appear in the UI, but the user
> will see the first-launch warning if the untrusted app is going to be
> launched via opening a document or a URL.
>
> I admin this is a little obscure for most, but we've got a whole
> Automation system built with AppleScript, and this is one issue that
> has come up.
>
> David Weiss
>
> On Jan 19, 2005, at 11:00 AM, David Weiss wrote:
>
> We have a problem with compiled AppleScripts prompting us to locate
> recently installed Microsoft applications (copied to a local folder by
> scripting Finder). We have also ran LSRegisterFSRef() on the
> application files after copying them to the local machine. What else
> do we need to do to get AppleScript to recognize that we have copied
> and registered an application on a machine and not prompt us to locate
> it? AppleScript is able to locate the applications without prompting
> if we have already launched all of the applications in the suite before
> loading the compiled script.
>
> David Weiss
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Applescript-users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden