Re: using AppKit additions in background threads

2011-09-07 Thread Martin Wierschin
> I've found that NSAttributedString's initWithData:... method does a good job > of the conversion ... > One drawback to my approach is that I can't get the web page title using > NSAttributesString. When you init the NSAttributedString, you can pass in a pointer to a document attributes dictio

Re: using AppKit additions in background threads

2011-09-06 Thread Michael Thon
On Sep 6, 2011, at 9:23 PM, Douglas Davidson wrote: > > On Sep 6, 2011, at 11:53 AM, Jens Alfke wrote: > >> On Sep 6, 2011, at 11:11 AM, Michael Thon wrote: >> >>> Yup, they're HTML, all right. Now I'm thinking of moving this code to a >>> separate command line app that I can call from the ma

Re: using AppKit additions in background threads

2011-09-06 Thread Mark Munz
>Yes that is a good question. Another is whether I can execute utilities in >/usr/bin from a App Store app. Typically that is not a problem if you are executing something that already exists there and then use paths that point to an approved location. But this does become an issue with sandboxin

Re: using AppKit additions in background threads

2011-09-06 Thread Michael Thon
On Sep 7, 2011, at 4:22 AM, Glenn L. Austin wrote: > I would ship the files pre-converted. > If I could do that I wouldn't have any of these problems in the first place. The app is converting users' documents. > On Sep 6, 2011, at 4:29 PM, Mark Munz wrote: > >> One thing that 3rd party dev

Re: using AppKit additions in background threads

2011-09-06 Thread Glenn L. Austin
I would ship the files pre-converted. On Sep 6, 2011, at 4:29 PM, Mark Munz wrote: > One thing that 3rd party developers *now* have to also consider: Can > you call /usr/bin/textutil in a sandboxed app? Based on all the > limitations I'm seeing when trying to sandbox an app, my bet is no -- > alt

Re: using AppKit additions in background threads

2011-09-06 Thread Mark Munz
One thing that 3rd party developers *now* have to also consider: Can you call /usr/bin/textutil in a sandboxed app? Based on all the limitations I'm seeing when trying to sandbox an app, my bet is no -- although I haven't tested this particular case. On Tue, Sep 6, 2011 at 1:48 PM, Jens Alfke wr

Re: using AppKit additions in background threads

2011-09-06 Thread Jens Alfke
On Sep 6, 2011, at 12:23 PM, Douglas Davidson wrote: > One possibility would be to convert the HTML to RTF or RTFD, which could be > loaded in the background. For that sort of conversion we already have a tool > on the system, /usr/bin/textutil. Wow, that is good to know about; I didn’t know

Re: using AppKit additions in background threads

2011-09-06 Thread Douglas Davidson
On Sep 6, 2011, at 11:53 AM, Jens Alfke wrote: > On Sep 6, 2011, at 11:11 AM, Michael Thon wrote: > >> Yup, they're HTML, all right. Now I'm thinking of moving this code to a >> separate command line app that I can call from the main application. It >> should work, but I'm not sure if I'd need

Re: using AppKit additions in background threads

2011-09-06 Thread Chris Hanson
On Sep 6, 2011, at 11:53 AM, Jens Alfke wrote: > The background tool will need to link against WebKit and AppKit, so it won’t > be strictly-speaking ‘background’. You can mark its bundle with a special key > (LSBackgroundOnly?) to keep it from showing up in the Dock or getting a > menu-bar thou

Re: using AppKit additions in background threads

2011-09-06 Thread Jens Alfke
On Sep 6, 2011, at 11:11 AM, Michael Thon wrote: > Yup, they're HTML, all right. Now I'm thinking of moving this code to a > separate command line app that I can call from the main application. It > should work, but I'm not sure if I'd need to provide a runloop for the HTML > importing to work

Re: using AppKit additions in background threads

2011-09-06 Thread Michael Thon
On Sep 6, 2011, at 6:23 PM, Douglas Davidson wrote: > > On Sep 6, 2011, at 9:20 AM, Michael Thon wrote: > >> I'm importing data to an NSAttributedString using the method: >> initWithData:options:documentAttributes:error: which is an AppKit addition >> to NSAttributedString. I'm doing this in

Re: using AppKit additions in background threads

2011-09-06 Thread Douglas Davidson
On Sep 6, 2011, at 9:20 AM, Michael Thon wrote: > I'm importing data to an NSAttributedString using the method: > initWithData:options:documentAttributes:error: which is an AppKit addition to > NSAttributedString. I'm doing this in an NSOperation running on a separate > thread, and what I see

using AppKit additions in background threads

2011-09-06 Thread Michael Thon
I'm importing data to an NSAttributedString using the method: initWithData:options:documentAttributes:error: which is an AppKit addition to NSAttributedString. I'm doing this in an NSOperation running on a separate thread, and what I see is that the UI of the app becomes unresponsive while thi