Re: Devmate: what are people using when it disappears?
Leo
I was in a similar situation last year - albeit not with DevMate: had to find an alternative to eSellerate.
toggle quoted messageShow quoted text
After a lengthy research and comparison of whatever licensing platforms I could find, I switched to SoftwareKey.com. To me they offered the best pricing model with all features I needed. Their customer support is also excellent. Since, unlike me, you're using FastSpring for e-commerce, your transition should be even easier as SoftwareKey already has some kind of established integration with FastSpring. One detail: I had a major requirement to any licensing platform: to provide a personal online license portal for the users. That is, a place where users can login at any time to manage their activations without having to contact me at all. This portal was also a major reason why I chose SoftwareKey. If you don't have such a requirement, you may have a wider range of platforms to choose from. In any case, switching to a different licensing platform is a major ordeal. If you have any questions let me know. Leo
On 9/19/19 7:58 PM, Graham Cox wrote:
Is anyone out there using Devmate as a means of handling licensing in their Mac apps?
|
|
Devmate: what are people using when it disappears?
Graham Cox
Is anyone out there using Devmate as a means of handling licensing in their Mac apps?
If so, you’ll know it’s deprecated as of December, and so far Fastspring, who bought out Devmate, appear not to have any real alternative. So if this is you, what are you planning to do about it? I’d like to get some sort of discussion going so that the various alternatives are laid out and a clear forward path becomes more obvious. At the moment I’m totally unclear what to do. Fastspring say “contact us” if we are affected by this, but having done so, they never reply. Very poor. —Graham
|
|
Re: Swift definition of "_"
Dave
Thanks, found it now. The documentation is pretty good, a cross reference/index would be icing of the cake!
toggle quoted messageShow quoted text
Cheers Dave
On 17 Sep 2019, at 13:39, Bernie Maier <apple-dev@...> wrote:
|
|
Re: Swift definition of "_"
Bernie Maier
On Tue, 17 Sep 2019, at 8:28 PM, Dave wrote:
Hi All,It means the corresponding function argument does not have a parameter label when **calling** the function. So you would call via something like: NSLocationInRange(42, someRange)This is documented in the Swift Language Guide (https://docs.swift.org/swift-book/LanguageGuide/Functions.html) Omitting Argument LabelsCheers, Bernie
|
|
Swift definition of "_"
Dave
Hi All,
In a definition like this: func NSLocationInRange(_ loc: Int, _ range: NSRange) -> Bool What does the “_” by itself mean? I can’t seem to find anywhere in the documentation where this is mentioned? If its in there somewhere I’d appreciate a pointer to it. Thanks in Advance Dave
|
|
Re: Swizzle class property?
Shane Stanley
On 27 Aug 2019, at 4:51 am, Jens Alfke <jens@...> wrote:
Thank you! It didn't occur to me because it's been working like that elsewhere for several years -- but with an instance method (and different class). Looking again, I'm not sure that class_replaceMethod() branch will ever work. I should probably just call class_addMethod(), and regardless of result call method_exchangeImplementations(). -- Shane Stanley <sstanley@...> <www.macosxautomation.com/applescript/apps/>, <latenightsw.com>
|
|
Re: Swizzle class property?
Shouldn't that be "if (!didAddMethod)" ? —Jens
|
|
Swizzle class property?
Shane Stanley
The subject more or less says it. I tried using code similar to how I do it with instance methods, to no avail. I'm now wondering if it's actually possible. (It's a read-only property, if that makes a difference.)
+ (void)load { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ Class theClass = [self class]; SEL originalSelector = @selector(classPropertyName); // name of original property SEL swizzledSelector = @selector(patchedClassPropertyName); // new method Method originalMethod = class_getClassMethod(theClass, originalSelector); Method swizzledMethod = class_getClassMethod(theClass, swizzledSelector); BOOL didAddMethod = class_addMethod(theClass, originalSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod)); if (didAddMethod) { class_replaceMethod(theClass, swizzledSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod)); } else { method_exchangeImplementations(originalMethod, swizzledMethod); } }); } -- Shane Stanley <sstanley@...> <www.macosxautomation.com/applescript/apps/>, <latenightsw.com>
|
|
NSImage/Bitmap and colorspaces
Jonathan Taylor
Hi all,
I have realised I’m having some subtle problems with images not being saved quite how I need them to be, and the problem seems to be caused by colorspace issues. Up until now I’ve kind of ignored the issue of colorspaces and presumed that things
will behave “reasonably” if I don’t go out of my way to specify something unusual - it turns out this optimism was misplaced! I am hoping somebody can help me with understanding colorspaces just enough that I don’t inadvertently cause anything unexpected to
happen. I am not concerned about pedantic photorealism on screen or on printed paper, but it is essential that I have precise control over the exact 3x8bit channel values written out to the TIFF files I am saving to disk.
At the moment I create a bitmap (specifying NSCalibratedRGBColorSpace just because that seemed like the most obvious one to use), populate it with the pixel values I want, add it to a new NSImage, call lockFocus on that NSImage, draw some annotations,
and save the image as a TIFF (by passing the bitmap data to libtiff). I have realised that this pipeline is interfering with the original pixel values I set - merely calling lockFocus is enough to cause the red channel to bleed slightly into the green.
I noticed that the colorspace for the bitmap has been changed to NSDeviceRGBColorSpace by the call to lockFocus, and the pixel values have been changed (bleeding into green). If I instead create the bitmap using NSDeviceRGBColorSpace (instead
of NSCalibratedRGBColorSpace) then a subsequent call to lockFocus does not seem to interfere with the pixel/channel values.
I also notice that if, instead of adding to an NSImage and drawing, I use:
[NSGraphicsContext
graphicsContextWithBitmapImageRep:theBitmap]
then there does not seem to be any problems with channel bleed-through (whichever colorspace I set for the bitmap).
So, I think my questions are:
- Can anyone point me to a basic explanation of Cocoa and colorspaces, giving me the minimal understanding I need given that I *don’t* want to do anything clever with colorspaces, I just want to “do the
right things” so that nothing weird happens.
- Do both the solutions I’ve described (NSDeviceRGBColorSpace + lockFocus, and graphicsContextWithBitmapImageRep) seem like they should be robust for what I want (i.e. not messing with the exact pixel
values I initially set manually in the bitmap)?
- Is one solution better than the other for any reason? I’m wondering, for example, if specifying NSDeviceRGBColorSpace from the outset would give better performance when it comes to drawing these images
to a window in my program (which I also do, so optimizing performance there would be a nice secondary consideration).
- A beyond-cocoa question: in the TIFF files I output (via libtiff), I write out the colorspace information (because I figure I might as well). Does anybody happen to have any advice on whether any scientific
image tools like ImageJ or commercial scientific renderers would pay any attention to the colorspace specified in the TIFF files? How important is it that I get the exact right colorspace for downstream software reading them (and if so then what is the “right”
one…)?
Cheers
Jonny
|
|
Re: Trouble implementing selection property
Steve Mills
It turns out that if you dink around enough, sooner or later things just work right. Maybe AppleScript was keeping a cached version of my dict in memory or something, but I quit Script Debugger and cleaned & built my app many times. Then suddenly it worked.
But now I'm getting this problem. Returning some objects to a script shows them as the wrong class. Like here's the AppleEvent when I request "keyword 1 of document 1": <NSAppleEventDescriptor: 'core'\'getd'{ '----':'obj '{ 'form':'indx', 'want':'Keyw', 'seld':1, 'from':'obj '{ 'form':'indx', 'want':'docu', 'seld':1, 'from':null() } }, &'csig':65536 }> Looks good. Now here's the object specifier as seen in my app's log when I have NSScriptingDebugLogLevel set to 1: Result: <NSAppleEventDescriptor: 'obj '{ 'from':'obj '{ 'from':null(), 'want':'docu', 'form':'name', 'seld':'utxt'("_Untitled") }, 'want':', 'form':'name', 'seld':'utxt'(" test picts 2") }> Notice the malformed value for the 2nd 'want'. It should be 'want':'Keyw', but it's 'want':' Looking at the returned object in Script Debugger shows the same thing when I view as AEPrint: 'obj '{ 'form':'name', 'want':', 'seld':'utxt'(" test picts 2"), 'from':'obj '{ 'form':'name', 'want':'docu', 'seld':'utxt'("_Untitled"), 'from':[0x0,104003f "Image Chest"] } } And viewed as Best shows: asset "test picts 2" of document "_Untitled" The class should be "keyword" not "asset". Why is AppleScript being annoying? -- Steve Mills Drummer, Mac geek
|
|
Trouble implementing selection property
Steve Mills
I'm not sure what I'm doing wrong when adding a "selection" property to my document class so the user can get and set the selected assets. When I run:
tell application "Image Chest" tell document 1 set blah to selection set selection to blah —>Can’t make asset 76 of document "_Untitled" into type specifier. end tell end tell I've tried using both NSIndexSpecifier and NSUniqueIDSpecifier when returning the objectSpecifier for the Asset class, and they work if I do something simple like: set blah to asset 1 of document 1 return name of blah The selection property is structured in the sdef as: <property name="selection" code="seld" description="The selected assets."> <type type="asset" list="yes" /> <cocoa key="scriptableSelection" /> </property> Do I need to override some method in some class, like indicesOfObjectsByEvaluatingObjectSpecifier:? I tried adding one of those to the Document class so I could inspect all the incoming specifiers, then returned nil so the default implementation would do the evaluation instead. It never gets called when the "set selection to blah" line is being run. It's been a long time since I've done any serious AppleScript implementation, and that was in a huge Carbon app. So maybe I'm trying to do something that's impossible? Maybe I instead need to add a "select" verb? -- Steve Mills Drummer, Mac geek
|
|
Re: Core Data missing mapping model
Steve Mills
On Aug 5, 2019, at 08:25:33, Steve Mills via Groups.Io <sjmills@...> wrote:
The problem was caused by a merge. Even though the mapping model LOOKED correct in the Xcode mapping model editor, the underlying data was bogus. So yeah, don't work on a mapping model (or probably any Core Data resource file) on more than one machine at a time and think that merging will magically work. -- Steve Mills Drummer, Mac geek
|
|
Core Data missing mapping model
Steve Mills
During development of a new version of my app, I added a new data model version with one additional attribute on one of the entities, and a mapping model to set the default value of that new required attribute. I was able to successfully migrate older documents to the new model. Now I can no longer do that, and I have no idea why. I get the error "Persistent store migration failed, missing mapping model." I'm using the options to do automatic migration and to NOT infer model mapping.
I've gone through the painstaking task of comparing the models that are spit out to the Xcode console, and they look correct - they match up with what should be in each model. I've checked the hashes on both the old and new models, and on the persistent store in an old document, and the hashes in the old document match the hashes in the old model. What else is Core Data being such a PITA about? God, this is so maddening. -- Steve Mills Drummer, Mac geek
|
|
Re: Arg! Document window restoration. Again.
Steve Mills
On Aug 1, 2019, at 09:30:12, Quincey Morris <quinceymorris@...> wrote:
I got it to work by calling the window's restoreStateWithCoder: instead of the document's. Another complication with #4 is that you’re on the hook to deal with changes in monitor configuration. If the screen sizes changes, or screens are added or removed, before the document is re-opened, you have to reposition the document sensibly. Built-in mechanisms for positioning the window do this for you in cases #1-#3.In my tests, it takes care of this and repositions the window so it's on the currently available screen[s] if the previous screen is not available. Yet another complication is the problem of what to do about read-only documents (or editable documents that aren’t dirty). Saving the window frame means you have to change the document file, so you’ll need to save and restore the file’s modification date around the change (if you can), or discard the frame (if you can’t).Not a problem. If the doc file's locked, I ain't changin' nothing'! -- Steve Mills Drummer, Mac geek
|
|
Re: Arg! Document window restoration. Again.
Quincey Morris
On Aug 1, 2019, at 06:00 , Steve Mills via Groups.Io <sjmills@...> wrote:
No, the window autosave name predates state restoration by a lot of years. IIRC, the behavior breaks down like this: 1. Window restoration (if enabled) overrides everything else, for windows that are being re-opened at launch. 2. Otherwise, the autosave frame is honored when a window of that type (a window having that autosave name) is opened. 3. Depending on the rest of the window configuration, multiple windows of the same type may be cascaded when opened. 4. Document windows are generally all of the same type, so there is no standard per-document behavior. If you want documents to return to their original frame when opened, you must store the frame in the document and set the window frame manually. #4 is a bit tricky when you’re using state restoration, because documents are opened via your regular code path before the restoration frame is applied. You have to be careful to avoid dueling frames producing strange results. Another complication with #4 is that you’re on the hook to deal with changes in monitor configuration. If the screen sizes changes, or screens are added or removed, before the document is re-opened, you have to reposition the document sensibly. Built-in mechanisms for positioning the window do this for you in cases #1-#3. Yet another complication is the problem of what to do about read-only documents (or editable documents that aren’t dirty). Saving the window frame means you have to change the document file, so you’ll need to save and restore the file’s modification date around the change (if you can), or discard the frame (if you can’t).
|
|
Re: Arg! Document window restoration. Again.
Keary Suska
Did something change recently? frameautosave has historically been the way to save a window’s frame, regardless of when the window was opened. Maybe you should take a second look. If you have a simple controller-window setup, you could also look at windowFrameAutosaveName.
toggle quoted messageShow quoted text
Keary Suska Esoteritech, Inc. "Demystifying technology for your home or business"
On Aug 1, 2019, at 7:00 AM, Steve Mills via Groups.Io <sjmills@...> wrote:
|
|
Re: Arg! Document window restoration. Again.
Steve Mills
On Jul 31, 2019, at 23:57:33, Jon Gotow <gotow@...> wrote:
From what I've experienced and read, that only helps for reopening docs on app launch, not on opening docs once launched. The OS only stores info for docs that were open when the app exits so it can restore the app to the same state (as long as you have "Close windows when quitting an app" turned off in System Prefs). -- Steve Mills Drummer, Mac geek
|
|
Re: Arg! Document window restoration. Again.
Jon Gotow
Can't you just set NSWindow.frameAutosaveName? Or does NSDocument get in the way of that?
toggle quoted messageShow quoted text
- Jon
On Jul 31, 2019, at 10:09 PM, Steve Mills via Groups.Io <sjmills@...> wrote:
|
|
Arg! Document window restoration. Again.
Steve Mills
Doc and window restoration is great when relaunching the app, but I also want each document's window to open to their last frame when the user opens documents. I can not find the right place to make that happen. I supposed I'll need to subclass the window controller or window? What I thought would work was to grab the saved restoration data (which I saved in the document by calling -encodeRestorableStateWithCoder: and specifically adding the window frame with a custom key in -window:willEncodeRestorableState:), feed the data to an NSKeyedUnarchiver, and pass that to -restoreStateWithCoder: from my document subclass' -windowControllerDidLoadNib: method. But that appears to do nothing. It doesn't even get around to calling the document's -window:didDecodeRestorableState: override.
Every time I need to do something beyond the basics with window restoration, I dread it because I know it will suck. -- Steve Mills Drummer, Mac geek
|
|
Re: Does anyone know what this error means?
Steve Christensen
There’s some mention of it here.
|
|