6.1.3 incompatible with 10.9 sandboxing
John
john at onechip.com
Tue Dec 3 15:36:32 EST 2013
The following functions use applescript to perform the functions provided by “ask file” and “answer file”. They work as expected and I can read and write files as needed from my app. When the app is built as a standalone everything words as expected. That’s the good news. The bad news is that I have the same problem after I sandbox the app. When the Save dialog appears there are issues. Under 10.9, it (the save dialog) flashes rapidly on the screen and it appears as if the app has crashed.
This seems really odd given I have bypassed LiveCodes functions. Does anyone have a clue?
function answerFile thePrompt theExtension
/*
Use Apple Script to present an Open dialog box and return a path. Returns empty if the user cancels or there
is an error. Optionally pass in a prompt (thePrompt) and file extention to filter with (theExtention).
Defaults to the documents folder when first used.
*/
local theScript, appleScriptResult, scratch
if theExtension is empty then -- choose the script based on extension. Empty prompts look fine.
put "choose file with prompt" & quote & thePrompt & quote into theScript
else
put "choose file of type {" & quote & theExtension & quote & "} with prompt" & quote & thePrompt & quote into theScript
end if
do theScript as "Applescript"
put the Result into appleScriptResult
if appleScriptResult contains quote then -- if there is a " then there is a path
put offset(quote,appleScriptResult) + 1 into scratch
return revUnixFromMacPath(char scratch to -2 of appleScriptResult)
else
return empty
end if
end answerFile
function askFile thePrompt theName
/*
Use Apple Script to present a Save dialog box and return a path. Returns empty if the user cancels or there
is an error. Optionally pass in a prompt (thePrompt) and default file name (theName)
Defaults to the documents folder when first used.
*/
local theScript, appleScriptResult, scratch
if theName is empty then -- choose the script based on the default file name. Empty prompts look fine.
put "choose file name with prompt" & quote & thePrompt & quote into theScript
else
put "choose file name with prompt" & quote & thePrompt & quote & "default name" & quote & theName & quote into theScript
end if
do theScript as "Applescript"
put the Result into appleScriptResult
if appleScriptResult contains quote then -- if there is a " then there is a path
put offset(quote,appleScriptResult) + 1 into scratch
return revUnixFromMacPath(char scratch to -2 of appleScriptResult)
else
return empty
end if
end askFile
On Dec 3, 2013, at 10:18 AM, John <John at OneChip.com> wrote:
> Trevor,
>
> I can’t tell you one way or the other if the later app was sandboxed or not. If it was implemented midway through the year, for instance June, then it is not sandboxed. I was also a bit off on my OS release dates (looked at the wrong column in a release date matrix) and both were built under 10.7.
>
> This is a very sad state of affairs. I hope the applescript path works as well.
>
> Thanks,
> John
>
>
> On Dec 3, 2013, at 5:56 AM, Trevor DeVore <lists at mangomultimedia.com> wrote:
>
>> On Tue, Dec 3, 2013 at 1:32 AM, John <john at onechip.com> wrote:
>>
>>> It was a long and confusing day or two, hence my multiple and rarely
>>> coherent posts to this list, but yes, I definitely do have apps approved
>>> and selling on the app store that uses “ask file” and write to disk.
>>
>>
>> One clarification - are you sure they were sandboxed?
>>
>>
>>> They were released in 2012 (from their release dates I am guessing one was
>>> released using 10.7 and the other using 10.8).
>>
>>
>> I have an app in the MAS from 2012 as well. The requirement for sandboxing
>> was implemented midway through 2012 I believe. I haven't been able to post
>> anything but 1 bug fix release (no new features) since that time. My last
>> update was August 2012.
>>
>> Looking forward to hearing if your AppleScript solution works.
>>
>> --
>> Trevor DeVore
>> Blue Mango Learning Systems
>> www.screensteps.com - www.clarify-it.com
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at 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 at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list