Re: Solution for how to allow LC 9.6.6 and up standalones to control other apps in macOS - was:Excel_Lib on Mac

2022-03-18 Thread matthias rebbe via use-livecode
I think those problems  are with newer macOS versions that come with those new 
privacy settings.


> Am 18.03.2022 um 22:30 schrieb Bob Sneidar via use-livecode 
> :
> 
> Of course, I am running MacOS 10.7.2. YMMV
> 
> Bob S
> 
> 
>> On Mar 18, 2022, at 14:28 , Bob Sneidar via use-livecode 
>>  wrote:
>> 
>> I might beg to differ. I created an app with 9.6.7 rc2 after giving it 
>> permissions to control Excel for Mac. After building the standalone, it has 
>> no problems sending Apple Events to Excel for Mac. 
>> 
>> I will double check later. 
>> 
>> Bob S
>> 
>> 
>>> On Mar 18, 2022, at 12:17 , matthias rebbe via use-livecode 
>>>  wrote:
>>> 
>>> First of all there is a bug report already. Unfortunately LC stuff is not 
>>> able to reproduce the problem. 
>>> But there a some users who reported that it is not possible in LC 9.6.6 and 
>>> up to control an other app from within a LC script using Apple script if 
>>> the app was not already listed under Livecode  in System 
>>> preferences/Security/Automation. For whatever reason there was not 
>>> the typical security pop up asking for confirmation. 
>>> 
>>> As a workaround it is possible to run the stack first with LC 9.6.3. With 
>>> that version the dialog pops up and the user can confirm. After that the 
>>> stack works also with 9.6.6 and up and is able to control that other app.
>>> 
>>> But what about standalones created with LC 9.6.6 and up? They will not show 
>>> up the dialog.
>> 
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Solution for how to allow LC 9.6.6 and up standalones to control other apps in macOS - was:Excel_Lib on Mac

2022-03-18 Thread Bob Sneidar via use-livecode
Of course, I am running MacOS 10.7.2. YMMV

Bob S


> On Mar 18, 2022, at 14:28 , Bob Sneidar via use-livecode 
>  wrote:
> 
> I might beg to differ. I created an app with 9.6.7 rc2 after giving it 
> permissions to control Excel for Mac. After building the standalone, it has 
> no problems sending Apple Events to Excel for Mac. 
> 
> I will double check later. 
> 
> Bob S
> 
> 
>> On Mar 18, 2022, at 12:17 , matthias rebbe via use-livecode 
>>  wrote:
>> 
>> First of all there is a bug report already. Unfortunately LC stuff is not 
>> able to reproduce the problem. 
>> But there a some users who reported that it is not possible in LC 9.6.6 and 
>> up to control an other app from within a LC script using Apple script if the 
>> app was not already listed under Livecode  in System 
>> preferences/Security/Automation. For whatever reason there was not 
>> the typical security pop up asking for confirmation. 
>> 
>> As a workaround it is possible to run the stack first with LC 9.6.3. With 
>> that version the dialog pops up and the user can confirm. After that the 
>> stack works also with 9.6.6 and up and is able to control that other app.
>> 
>> But what about standalones created with LC 9.6.6 and up? They will not show 
>> up the dialog.
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Solution for how to allow LC 9.6.6 and up standalones to control other apps in macOS - was:Excel_Lib on Mac

2022-03-18 Thread Bob Sneidar via use-livecode
I might beg to differ. I created an app with 9.6.7 rc2 after giving it 
permissions to control Excel for Mac. After building the standalone, it has no 
problems sending Apple Events to Excel for Mac. 

I will double check later. 

Bob S


> On Mar 18, 2022, at 12:17 , matthias rebbe via use-livecode 
>  wrote:
> 
> First of all there is a bug report already. Unfortunately LC stuff is not 
> able to reproduce the problem. 
> But there a some users who reported that it is not possible in LC 9.6.6 and 
> up to control an other app from within a LC script using Apple script if the 
> app was not already listed under Livecode  in System 
> preferences/Security/Automation. For whatever reason there was not 
> the typical security pop up asking for confirmation. 
> 
> As a workaround it is possible to run the stack first with LC 9.6.3. With 
> that version the dialog pops up and the user can confirm. After that the 
> stack works also with 9.6.6 and up and is able to control that other app.
> 
> But what about standalones created with LC 9.6.6 and up? They will not show 
> up the dialog.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Solution for how to allow LC 9.6.6 and up standalones to control other apps in macOS - was:Excel_Lib on Mac

2022-03-18 Thread matthias rebbe via use-livecode
Please let me correct, i did not submit that report, i just commented to it. 
Tim Bobo submitted it.




> Am 18.03.2022 um 21:48 schrieb Richard Gaskin via use-livecode 
> :
> 
> 
> Thank you for submitting that report, Matthias.
> 
> Those of us who do consulting understand that there's been a huge transition 
> over the last several years away from custom development of complete systems 
> to integrating between existing systems.
> 
> On macOS, AppleScript plays a key role in integration.
> 
> Given the state of the market for tools like LC, anything that makes it 
> easier to use LC in an integration role bodes well for us, the company, and 
> end-users alike.
> 
> -- 
> Richard Gaskin
> Fourth World Systems
> 
> 
> 
> Matthias wrote:
>> Ups, forgot to add the link to the bug report
>> https://quality.livecode.com/show_bug.cgi?id=23576
>>> Am 18.03.2022 um 20:17 schrieb matthias rebbe via use-livecode 
>>> :
>>> First of all there is a bug report already. Unfortunately LC stuff is not 
>>> able to reproduce the problem. But there a some users who reported that it 
>>> is not possible in LC 9.6.6 and up to control an other app from within a LC 
>>> script using Apple script if the app was not already listed under Livecode  
>>> in System preferences/Security/Automation. For whatever reason 
>>> there was not the typical security pop up asking for confirmation. As a 
>>> workaround it is possible to run the stack first with LC 9.6.3. With that 
>>> version the dialog pops up and the user can confirm. After that the stack 
>>> works also with 9.6.6 and up and is able to control that other app.
>>> But what about standalones created with LC 9.6.6 and up? They will not show 
>>> up the dialog.
>>> To get this working, the standalones need some additional information in 
>>> the info.plist and they need to be code signed with entitlements. At least 
>>> with the entitlement
>>> com.apple.security.automation.apple-events
>>> So after you've created the macOS standalone you have to modify the 
>>> info.plist of that standalone and then you have to codesign it with 
>>> entitlements. After that your app created with 9.6.6 will show that 
>>> security dialog.
>>> Is that easy? No.
>>> I've solved it this way as a workaround, so i do not have to do this 
>>> manually after each standalone building process.
>>> 1. I created a folder 'entitlements' in the folder   'My 
>>> Livecode/resources/'
>>> 2. I copied an entitlements file into that folder and named it 
>>> 'entitlements.plist'.
>>> My entitlements.plist file contains all entitlements as suggested by 
>>> the following lesson.  
>>> https://lessons.livecode.com/m/4071/l/1293515-entitlements-for-signed-and-notarized-apps
>>> 3. I edited the sample info.plist file in the Livecode App bundle  
>>> Livecode...app/Contents/Tools/Runtime/Mac OS 
>>> X/x86-64/Standalone.app/Contents/info.plist
>>>   I added the following two lines to it
>>> NSAppleEventsUsageDescription
>>> This app needs permission to use Apple Script
>>> I placed it directly under the line
>>>  This app requires permission to access your Media 
>>> Library
>>> 4. I edited the stack script of the stack revSaveAsStandalone, better said 
>>> i modified the handler performAdHocCodesign pAppBundle
>>> I commented out the line put "codesign --deep -f -s -" && quote & 
>>> pAppBundle & quote into tShell
>>> and put the following lines after that line
>>> if there is a file 
>>> revEnvironmentUserResourcesPath()&"/entitlements/entitlement.plist"
>>> then
>>> put "codesign --deep --entitlements" && quote 
>>> ()&"/entitlements/entitlement.plist" & 
>>> Quote && "-f -s -" && quote & pAppBundle & quote into tShell
>>> else
>>> put "codesign --deep -f -s -" && quote & pAppBundle & quote into tShell
>>> end if
>>> Now when i create a macOS standalone the standalone contains the needed 
>>> information in the info.plist and LC does an adhoc codesigning, as it did 
>>> before, but now with entitlements.
>>> With this created app the security dialog pops up right away.
>>> If i want, for whatever reason, to create an macOS without that 
>>> modification, then i just have to rename my entitlements.plist file and LC 
>>> does the normal adhoc code signing as it did before.
>>> The above steps 3 and 4 have to be done for each LC edition that does have 
>>> this 'problem'. But if you are like me then you need to do this only for 
>>> the most current version.
>>> Hope this helps the one or other.
>>> Matthias
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:

Re: Solution for how to allow LC 9.6.6 and up standalones to control other apps in macOS - was:Excel_Lib on Mac

2022-03-18 Thread Richard Gaskin via use-livecode



Thank you for submitting that report, Matthias.

Those of us who do consulting understand that there's been a huge 
transition over the last several years away from custom development of 
complete systems to integrating between existing systems.


On macOS, AppleScript plays a key role in integration.

Given the state of the market for tools like LC, anything that makes it 
easier to use LC in an integration role bodes well for us, the company, 
and end-users alike.


--
 Richard Gaskin
 Fourth World Systems



Matthias wrote:

Ups, forgot to add the link to the bug report

https://quality.livecode.com/show_bug.cgi?id=23576


Am 18.03.2022 um 20:17 schrieb matthias rebbe via use-livecode :

First of all there is a bug report already. Unfortunately LC stuff is not able to reproduce the problem. 
But there a some users who reported that it is not possible in LC 9.6.6 and up to control an other app from within a LC script using Apple script if the app was not already listed under Livecode  in System preferences/Security/Automation. For whatever reason there was not the typical security pop up asking for confirmation. 


As a workaround it is possible to run the stack first with LC 9.6.3. With that 
version the dialog pops up and the user can confirm. After that the stack works 
also with 9.6.6 and up and is able to control that other app.

But what about standalones created with LC 9.6.6 and up? They will not show up 
the dialog.

To get this working, the standalones need some additional information in the info.plist and they need to be code signed with entitlements. At least with the entitlement 
	com.apple.security.automation.apple-events


So after you've created the macOS standalone you have to modify the info.plist 
of that standalone and then you have to codesign it with entitlements. After 
that your app created with 9.6.6 will show that security dialog.

Is that easy? No.

I've solved it this way as a workaround, so i do not have to do this manually 
after each standalone building process.


1. I created a folder 'entitlements' in the folder   'My Livecode/resources/'

2. I copied an entitlements file into that folder and named it 
'entitlements.plist'.
	My entitlements.plist file contains all entitlements as suggested by the following lesson. 
	https://lessons.livecode.com/m/4071/l/1293515-entitlements-for-signed-and-notarized-apps


3. I edited the sample info.plist file in the Livecode App bundle  
Livecode...app/Contents/Tools/Runtime/Mac OS 
X/x86-64/Standalone.app/Contents/info.plist
   I added the following two lines to it
NSAppleEventsUsageDescription
This app needs permission to use Apple Script

I placed it directly under the line
  This app requires permission to access your Media Library

4. I edited the stack script of the stack revSaveAsStandalone, better said i 
modified the handler performAdHocCodesign pAppBundle

I commented out the line 
put "codesign --deep -f -s -" && quote & pAppBundle & quote into tShell

and put the following lines after that line

if there is a file 
revEnvironmentUserResourcesPath()&"/entitlements/entitlement.plist"

then

put "codesign --deep --entitlements" && quote ()&"/entitlements/entitlement.plist" 
& Quote && "-f -s -" && quote & pAppBundle & quote into tShell

else

put "codesign --deep -f -s -" && quote & pAppBundle & quote into tShell

end if


Now when i create a macOS standalone the standalone contains the needed 
information in the info.plist and LC does an adhoc codesigning, as it did 
before, but now with entitlements.
With this created app the security dialog pops up right away.
If i want, for whatever reason, to create an macOS without that modification, 
then i just have to rename my entitlements.plist file and LC does the normal 
adhoc code signing as it did before.

The above steps 3 and 4 have to be done for each LC edition that does have this 
'problem'. But if you are like me then you need to do this only for the most 
current version.


Hope this helps the one or other.

Matthias



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Solution for how to allow LC 9.6.6 and up standalones to control other apps in macOS - was:Excel_Lib on Mac

2022-03-18 Thread matthias rebbe via use-livecode
Ups, forgot to add the link to the bug report

https://quality.livecode.com/show_bug.cgi?id=23576

> Am 18.03.2022 um 20:17 schrieb matthias rebbe via use-livecode 
> :
> 
> First of all there is a bug report already. Unfortunately LC stuff is not 
> able to reproduce the problem. 
> But there a some users who reported that it is not possible in LC 9.6.6 and 
> up to control an other app from within a LC script using Apple script if the 
> app was not already listed under Livecode  in System 
> preferences/Security/Automation. For whatever reason there was not 
> the typical security pop up asking for confirmation. 
> 
> As a workaround it is possible to run the stack first with LC 9.6.3. With 
> that version the dialog pops up and the user can confirm. After that the 
> stack works also with 9.6.6 and up and is able to control that other app.
> 
> But what about standalones created with LC 9.6.6 and up? They will not show 
> up the dialog.
> 
> To get this working, the standalones need some additional information in the 
> info.plist and they need to be code signed with entitlements. At least with 
> the entitlement 
>   com.apple.security.automation.apple-events
> 
> So after you've created the macOS standalone you have to modify the 
> info.plist of that standalone and then you have to codesign it with 
> entitlements. After that your app created with 9.6.6 will show that security 
> dialog.
> 
> Is that easy? No.
> 
> I've solved it this way as a workaround, so i do not have to do this manually 
> after each standalone building process.
> 
> 
> 1. I created a folder 'entitlements' in the folder   'My Livecode/resources/'
> 
> 2. I copied an entitlements file into that folder and named it 
> 'entitlements.plist'.
>   My entitlements.plist file contains all entitlements as suggested by 
> the following lesson. 
>   
> https://lessons.livecode.com/m/4071/l/1293515-entitlements-for-signed-and-notarized-apps
> 
> 3. I edited the sample info.plist file in the Livecode App bundle  
> Livecode...app/Contents/Tools/Runtime/Mac OS 
> X/x86-64/Standalone.app/Contents/info.plist
>I added the following two lines to it
>   NSAppleEventsUsageDescription
>   This app needs permission to use Apple Script
> 
> I placed it directly under the line
>   This app requires permission to access your Media 
> Library
> 
> 4. I edited the stack script of the stack revSaveAsStandalone, better said i 
> modified the handler performAdHocCodesign pAppBundle
> 
> I commented out the line 
> put "codesign --deep -f -s -" && quote & pAppBundle & quote into tShell
> and put the following lines after that line
> 
> if there is a file 
> revEnvironmentUserResourcesPath()&"/entitlements/entitlement.plist"
> 
> then
> 
> put "codesign --deep --entitlements" && quote 
> ()&"/entitlements/entitlement.plist" & Quote 
> && "-f -s -" && quote & pAppBundle & quote into tShell
> 
> else
> 
> put "codesign --deep -f -s -" && quote & pAppBundle & quote into tShell
> 
> end if
> 
> 
> Now when i create a macOS standalone the standalone contains the needed 
> information in the info.plist and LC does an adhoc codesigning, as it did 
> before, but now with entitlements.
> With this created app the security dialog pops up right away.
> If i want, for whatever reason, to create an macOS without that modification, 
> then i just have to rename my entitlements.plist file and LC does the normal 
> adhoc code signing as it did before.
> 
> The above steps 3 and 4 have to be done for each LC edition that does have 
> this 'problem'. But if you are like me then you need to do this only for the 
> most current version.
> 
> 
> Hope this helps the one or other.
> 
> Matthias
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Solution for how to allow LC 9.6.6 and up standalones to control other apps in macOS - was:Excel_Lib on Mac

2022-03-18 Thread matthias rebbe via use-livecode
First of all there is a bug report already. Unfortunately LC stuff is not able 
to reproduce the problem. 
But there a some users who reported that it is not possible in LC 9.6.6 and up 
to control an other app from within a LC script using Apple script if the app 
was not already listed under Livecode  in System 
preferences/Security/Automation. For whatever reason there was not the 
typical security pop up asking for confirmation. 

As a workaround it is possible to run the stack first with LC 9.6.3. With that 
version the dialog pops up and the user can confirm. After that the stack works 
also with 9.6.6 and up and is able to control that other app.

But what about standalones created with LC 9.6.6 and up? They will not show up 
the dialog.

To get this working, the standalones need some additional information in the 
info.plist and they need to be code signed with entitlements. At least with the 
entitlement 
com.apple.security.automation.apple-events

So after you've created the macOS standalone you have to modify the info.plist 
of that standalone and then you have to codesign it with entitlements. After 
that your app created with 9.6.6 will show that security dialog.

Is that easy? No.

I've solved it this way as a workaround, so i do not have to do this manually 
after each standalone building process.


1. I created a folder 'entitlements' in the folder   'My Livecode/resources/'

2. I copied an entitlements file into that folder and named it 
'entitlements.plist'.
My entitlements.plist file contains all entitlements as suggested by 
the following lesson. 

https://lessons.livecode.com/m/4071/l/1293515-entitlements-for-signed-and-notarized-apps

3. I edited the sample info.plist file in the Livecode App bundle  
Livecode...app/Contents/Tools/Runtime/Mac OS 
X/x86-64/Standalone.app/Contents/info.plist
I added the following two lines to it
NSAppleEventsUsageDescription
This app needs permission to use Apple Script
  
 I placed it directly under the line
   This app requires permission to access your Media 
Library

4. I edited the stack script of the stack revSaveAsStandalone, better said i 
modified the handler performAdHocCodesign pAppBundle

I commented out the line 
put "codesign --deep -f -s -" && quote & pAppBundle & quote into tShell
and put the following lines after that line

if there is a file 
revEnvironmentUserResourcesPath()&"/entitlements/entitlement.plist"

then

put "codesign --deep --entitlements" && quote 
()&"/entitlements/entitlement.plist" & Quote && 
"-f -s -" && quote & pAppBundle & quote into tShell

else

put "codesign --deep -f -s -" && quote & pAppBundle & quote into tShell

end if


Now when i create a macOS standalone the standalone contains the needed 
information in the info.plist and LC does an adhoc codesigning, as it did 
before, but now with entitlements.
With this created app the security dialog pops up right away.
If i want, for whatever reason, to create an macOS without that modification, 
then i just have to rename my entitlements.plist file and LC does the normal 
adhoc code signing as it did before.

The above steps 3 and 4 have to be done for each LC edition that does have this 
'problem'. But if you are like me then you need to do this only for the most 
current version.


Hope this helps the one or other.

Matthias

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode