Closed ansverch closed 9 years ago
Is this working for you in both 10.9 and 10.10? I can't seem to find any reference to openFile:withApplication:options:andDeactivate:
in the documentation, and it fails for me in 10.10. Was it possibly openURLs:withAppBundleIdentifier:options:additionalEventParamDescriptor:launchIdentifiers:
?
It work in both 10.9 and 10.10 for me.
I didn't find any official reference as well, got idea from here: http://stackoverflow.com/questions/5453880/objective-c-launch-itunes-in-background
You right, it was about launchApplicationAtURL
I wonder why this solved my issue. Tested few times to make sure this is all changes I made.
I think Skala Preview will actually reload an image file that it has open when that file is updated. My best guess is that the preview image was already open, so when the modified plugin was run, it exported the preview image, then hits the point where it opens the file in Skala Preview, then fails there.
Have you had the plugin as changed in this PR work after restarting both Sketch and Skala Preview?
Actually, yeah, looks like Skala Preview reloads image when file is updated. When I tested modified plugin, Skala Preview was already running and had image in it. But when I restart both apps, plugin fails to work.
Also, I tried to replace NSWorkspaceLaunchAndHide
option with any other string — it still works if image was already in Skala Preview. Looks like plugin just fails at that line. Thats why Skala Preview doesn't go front and this was a "solution" for me, kinda.
I came up with idea, what if to modify plugin so Skala will not be launched if it is already open and has preview image in it? Plugin just updates file then. This will guarantee that Sketch will stay front. My coding skills are not enough to do that, so it's up to you.
I'm sorry for misleading you with my "solution". Hope, you find this helpful somehow.
I had considered this in the past, but I decided against it. I think the reload behavior isn't documented, so I was concerned that it might change in the future, or there may have been some circumstances under which it behaved differently. Also I had initially designed the plugin thinking that users could configure it to use other preview applications, and they might not behave the same way. To date I'm not actually aware of anyone doing that though.
Thanks for all your effort with this. I'm planning to update the plugin to use the new bundle format that was released with 3.3, so I'll put some thought into changing this along with that.
I updated the plugin for the new bundle format today, and I wasn't able to think of a good way to address this issue on 10.9. The main problem is that even if I can tell if Skala Preview
is already running, I don't have a good way to know what file is currently open in it.
As 10.9 user, I can say that Skala Preview
still goes front. I start thinking maybe this is my system case. I'll test on another machine when I get a chance.
Thank you for plugin support!
Fix for #16 when Skala goes front on every ⌘P