There is no

Andre Garzia andre at
Tue Mar 22 06:36:10 EDT 2022


Another way to check if an application is installed on a mac is by using AppleScript. Here are some functions that work together to check if TextEdit is installed.

function q txt
  return quote & txt & quote
end q

function isApplicationInstalledByBundleID pID
  put "try" & cr into tScript
  put "tell application " & q("Finder") & " to get application file id " & q(pID) & cr after tScript
  put "return true" & cr after tScript
  put "on error" & cr after tScript
  put "return false" & cr after tScript
  put "end try" & cr after tScript

  do tScript as “applescript"

  if the result is "{true}” then
    return true
    return false
  end if
end isApplicationInstalledByBundleID

function isTextEditInstalled
  return isApplicationInstalledByBundleID("")
end isTextEditInstalled

> On 21 Mar 2022, at 22:58, Bob Sneidar via use-livecode <use-livecode at> wrote:
> I have the following in a script, and it does not seem to be able to find the application on a Mac! 
>   put "/Applications/" into tTextEditorPath
>   if there is a folder tTextEditorPath  then 
>         put true into tValidPath
>   end if
>   if tValidPath is false then 
>      put empty into tTextEditorPath
>   end if
> That cannot be right. 
> MacOS Catalina 10.15.7 LC 9.6.7 lc2. 
> Bob S
> _______________________________________________
> use-livecode mailing list
> use-livecode at
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:

More information about the use-livecode mailing list