Sandbox friendly version of this check

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
doobox
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 284
Joined: Tue May 24, 2011 11:47 pm

Sandbox friendly version of this check

Post by doobox » Sun Nov 25, 2012 4:24 pm

Hi there,

I have just made this to test if another application is currently running.
But i am pretty sure this is not sandbox friendly, and will get a rejection.
Can anyone think of a way to test if another app is currently running that will be sandbox friendly.
I think accessing system events is a no no, right..?

Code: Select all

// Check if Another application is running
function isApplicationRunning pTheApplication -- where pTheApplication is the name of the application
   do "tell application" && quote & "System Events" & quote & cr \
         & "count (every process whose name is" && quote & pTheApplication & quote & ")" & cr \
         & "end tell" as applescript
   return the result -- greater than 0 if running, 0 if not
end isApplicationRunning
Kind Regards
Gary

https://www.doobox.co.uk

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Sandbox friendly version of this check

Post by Mark » Tue Dec 04, 2012 3:41 pm

Hi Gary,

it looks like you need an external if you want to do this in a really sandbox-friendly way but it should also be possible to set a temporary exception entitlement that allows you to retrieve information from e.g. Finder or System Events using AppleScript.

With App Sandbox, you can receive Apple events and respond to Apple events, but you cannot send Apple events to arbitrary apps. By using a temporary exception entitlement, you can enable the sending of Apple events to a list of specific apps that you specify.

More info at http://qery.us/3b8.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: Sandbox friendly version of this check

Post by Mag » Sun Aug 24, 2014 11:31 am

Hi Mark,

the URL you posted no longer works. Is this the page you refer to?

https://developer.apple.com/library/mac ... 95-CH5-SW3

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Sandbox friendly version of this check

Post by Mark » Sun Aug 24, 2014 10:03 pm

Hi,

It looks like it was this website http://qery.us/cdu but Apple made some changes and the original text is no longer there as far as I can see.

Kind regards,

Mark
Last edited by Mark on Wed Aug 27, 2014 7:57 am, edited 1 time in total.
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: Sandbox friendly version of this check

Post by Mag » Wed Aug 27, 2014 12:47 am

Thank you Mark

Post Reply