Saturday, October 1, 2022

#1 2022-09-19 03:24:17 pm

robertfern
Member
Registered: 2011-11-29
Posts: 202

Test if script running as standalone app

I tried searching but couldn't find if there was/is a way to test if the current running script is running in a standalone app?

Any help would be appreciated

Offline

 

#2 2022-09-19 04:11:19 pm

Nigel Garvey
Moderator
From:: Warwickshire, England
Registered: 2002-11-20
Posts: 5568

Re: Test if script running as standalone app

Hi Robert.

If this what you mean?

Applescript:

if ((path to me) = (path to current application)) then
   say "yes"
else
   say "no"
end if


NG

Offline

 

#3 2022-09-19 04:18:34 pm

robertfern
Member
Registered: 2011-11-29
Posts: 202

Re: Test if script running as standalone app

Thanks.

I knew it had to be simple.

Offline

 

#4 2022-09-25 03:37:53 pm

Fredrik71
Member
Registered: 2019-10-23
Posts: 973

Re: Test if script running as standalone app

Other approach but not better and Nigels

Applescript:

if (path to me as text) contains ".app" then
   say true
end if


Node-RED makes it easy to automate IoT

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)