Skip to content

Commit 485cbd2

Browse files
committed
Still working on BkmkMgrs 1.22.23
• Fixed three more bugs in the Lazy Data Source, ContentDataSource class: One in --checkAllProxies:bkmxDoc:, one in -objectsChangedNote:, and one in -noteChangedChildrenForStark:. The latter two were quite heinous – changing a stark owned by an Extore during an Import or Export would whack live ContentProxy objects out of the cache! • Now supports Firefox Developer Edition • Reworded the "Stop Syncing" menu item again • Added comments to category NSMenu (SSYShoeboxDocument) explaining that it is not applicble to OS X 10.9 and above • Now supports Firefox Developer Edition • Replaced depracated Process Manager function ShowHideProcess() with -[NSRunningApplication hide]. • Added new category, NSRunningApplication (SSYHideReliably) • Added parameter +[SSYOtherApper launchApplicationPath:activate:hideGuardTime:error_p:] • Added new method +[SSYOtherApper launchAsHiddenAppPath:launchTimeout:hideGuardTime:error_p:] which uses AppleScript, "the only way to reliably launch an app as hidden" (unless it's like Google Chrome and throws up a window immediately after launch). • Fixed Header Doc in SSYPathObserver and SSYPathWaiter classes. • Fixed bug which sometimes caused Firefox or Chrome to be not quit after it was launched to perform an import or export operation, if the user has more than one instance of Firefox or Chrome installed. (Because it would quit an instance that was not even running. Now remembers the path to the launched app.) • When running one of the three focused apps, the popover which OS X 10.9 or 10.10 provides next to the document window title has been removed, so that it is no longer possible for the user change the document's name or location and lose it (because the focused apps have a "shoebox" architecture which does not support multiple documents.)
1 parent a8b9734 commit 485cbd2

5 files changed

+191
-156
lines changed

SSYOtherApper.h

+49-5
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,68 @@ typedef enum SSYOtherApperProcessState_enum SSYOtherApperProcessState ;
3434
*/
3535
__attribute__((visibility("default"))) @interface SSYOtherApper : NSObject {}
3636

37+
3738
/*!
38-
@brief Launches an application specified by its bundle path (i.e.
39-
/path/to/SomeApp.app) and optionally activates it (brings to to the
39+
@brief Launches an application specified by its bundle path (i.e.
40+
/path/to/SomeApp.app) and optionally activates it (brings to to the
4041
front)
4142
43+
@details The newer method
44+
+launchAsHiddenAppPath:launchTimeout:hideGuardTime:error_p: is recommended
45+
instead of this one when activate = NO because it more reliably launches
46+
the app to be completely hidden (no windows open), not even for milliseconds.
47+
48+
TODO: Combine that method into this one, and use it to launch both Firefox
49+
and Chromy. I have not done that yet because (a) for Firefox, I could only
50+
use it for the 99% of users who have only one Firefox profile and thus do not
51+
need a -profile command-line argument passed to Firefox, and (b) it will not
52+
work for Chrome anyhow because Chrome always opens a window even if you
53+
launch it as "hidden", for example with this Applescript that is supposed to
54+
open apps hidden:
55+
. with timeout of 8.0 seconds
56+
. try
57+
. tell application "/Applications/Google Chrome.app"
58+
. set x to frontmost
59+
. do shell script "x > /dev/null"
60+
. end tell
61+
. end try
62+
. end timeout
63+
4264
@param activate If the specified application is not already
4365
launched, the newly-launched application is activated if YES, and
4466
if NO is not activated. If the specified application is already
45-
launched, this parameter will activate or deactivate it if this code is
46-
compiled with the Mac OS X 10.6 or later, or else do nothing.
67+
launched, this parameter will activate or deactivate it.
68+
@param hideGuardTime I have seen apps show windows after they have been
69+
launched as hidden. I think this may be due to windows being restored in
70+
OS X 10.7+. If hideGuardTime is > 0 and activate is NO, after the target
71+
app launches, this method will repeatedly send its NSRunningApplication a
72+
-hide message for an additional hideGuardTime seconds. If activate is YES,
73+
hideGuardTime is ignored.
4774
@param error_p If not NULL and if an error occurs, upon return,
4875
will point to an error object encapsulating the error.
4976
@result YES if the method completed successfully, otherwise NO
5077
*/
5178
+ (BOOL)launchApplicationPath:(NSString*)path
5279
activate:(BOOL)activate
80+
hideGuardTime:(NSTimeInterval)hideGuardTime
5381
error_p:(NSError**)error_p ;
54-
82+
83+
/*!
84+
@brief Launches an app hidden, showing no windows, and blocks until after
85+
the app is running, and possibly for an additional "guard" time after that,
86+
during which it ensures that the launched app stays hidden
87+
88+
@details Most reliably launches an app as hidden, without any windows
89+
showing even for milliseconds, because it launches the app with the only
90+
known technique for launching and hiding: AppleScript 'tell application'.
91+
*/
92+
+ (BOOL)launchAsHiddenAppPath:(NSString*)path
93+
launchTimeout:(NSTimeInterval)launchTimeout
94+
hideGuardTime:(NSTimeInterval)hideGuardTime
95+
error_p:(NSError**)error_p ;
96+
97+
98+
5599
+ (NSImage*)iconForAppWithBundleIdentifier:(NSString*)bundleIdentifier ;
56100

57101
/*!

0 commit comments

Comments
 (0)