Re: App not found action
Re: App not found action
- Subject: Re: App not found action
- From: Emmanuel LEVY <email@hidden>
- Date: Sun, 23 Nov 2014 23:09:05 +0100
We have the same problem: we want to compile scripts which call Safari without launching Safari. Probably some better solution exists these days, but in case it helps here is what we do:
1. instead of: tell application "Safari" we prevent AS to guess what app we are calling by writing for instance: tell application ("Saf" & "ari"),
2. we use the 4-char codes instead of the normal terminology, which gives horrible stuff like:
tell application ("Saf" & "ari") to set res to «event sfridojs» theScript given «class dcnm»:document 1
We use Smile's "tell / Copy translate" commands to provide the 4-char codes.
Best,
Emmanuel
On Nov 23, 2014, at 10:37 PM, Robert Poland wrote:
> Hi,
>
> The snippets below are meant to run as an app on several computers as a morning startup. Several apps are meant to excluded on “Smaller” computers.
>
> PROBLEM;
> On a “Smaller” computer BOINCManager is not installed. So it causes the script to stop, wanting BOINCManager to be found. Why does’t the try block avoid this, how do I avoid this?
>
> tell (do shell script "/usr/sbin/system_profiler SPDisplaysDataType | grep Resolution") to set {screenWidth} to {word 2 as number} -- get screen width of monitor
> if screenWidth > 2000 then
> set largeMonitor to true
> else
> set largeMonitor to false
> end if
>
> tell application "System Events"
> set processlist to name of every process
> ignoring application responses
> try
> if largeMonitor then if "BOINCManager" is not in processlist then launch application "BOINCManager.app"
> end try
> end ignoring
> end tell
>
> TIA,
>
> Robert Poland
> Fort Collins CO
>
>
> _______________________________________________
> 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
_______________________________________________
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