{"id":202864,"date":"2013-11-20T15:22:02","date_gmt":"2013-11-20T11:22:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=202864"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=202864","title":{"rendered":"<span class=\"post_title\">\u0421\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0432 Dock \u0434\u043b\u044f \u043b\u0435\u043d\u0438\u0432\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e AppleScript<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u041a\u0430\u043a \u0447\u0430\u0441\u0442\u043e \u0432\u044b \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435\u0441\u044c \u043e\u043f\u0446\u0438\u044f\u043c\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c (iTerm 2, Total Finder, Adium), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u043a\u043d\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044e \u043d\u0430 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0445\u043e\u0442\u043a\u0435\u0439 \u0438 \u0441\u043a\u0440\u044b\u0442\u044c \u044d\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u043f\u043e\u0442\u0435\u0440\u0435 \u0444\u043e\u043a\u0443\u0441\u0430? \u041b\u0438\u0447\u043d\u043e \u044f \u2014 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e. \u0410 \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043d\u0435\u043a\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0442\u0430\u043a\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u0438 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043c\u0430\u044f\u0447\u0438\u0442 \u043f\u0435\u0440\u0435\u0434 \u0433\u043b\u0430\u0437\u0430\u043c\u0438? \u0422\u043e\u0442 \u0436\u0435 Skype, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440. \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0432 \u043f\u043e\u0440\u044f\u0434\u043e\u043a.<br \/>  <a name=\"habracut\"><\/a><\/p>\n<h2>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0438 \u0441\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e \u0445\u043e\u0442\u043a\u0435\u044e<\/h2>\n<p>  \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e. \u0417\u0430\u0434\u0430\u0447\u0430: \u043f\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044e \u043d\u0430 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0445\u043e\u0442\u043a\u0435\u0439 \u0438\u0437 \u043b\u044e\u0431\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0444\u043e\u043a\u0443\u0441 Skype \u0438 \u044d\u0442\u0438\u043c \u0436\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435\u043c \u0435\u0433\u043e \u0441\u043a\u0440\u044b\u0442\u044c. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 <a href=\"http:\/\/superuser.com\/a\/309144\">\u0446\u0435\u043b\u044b\u0439 \u043f\u0430\u0440\u043a<\/a> \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e. \u041e\u0434\u043d\u0430\u043a\u043e \u043c\u044b \u043d\u0435 \u0438\u0449\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043f\u0443\u0442\u0435\u0439 \u0438 \u043d\u0435 \u0433\u043e\u0442\u043e\u0432\u044b \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043a\u0438 \u0434\u043b\u044f \u044d\u0442\u0438\u0445 \u0446\u0435\u043b\u0435\u0439. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 Automator \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 \u0438 \u043f\u043e\u0432\u0435\u0441\u0438\u0442\u044c \u0445\u043e\u0442\u043a\u0435\u0439 \u043d\u0430 \u0435\u0433\u043e \u0432\u044b\u0437\u043e\u0432 \u0438\u0437 \u043b\u044e\u0431\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c Automator, \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0442\u0438\u043f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 <b>\u0421\u043b\u0443\u0436\u0431\u0430<\/b>. \u0412 \u0441\u043f\u0438\u0441\u043a\u0435 <b>\u0421\u043b\u0443\u0436\u0431\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442<\/b> \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c <i>\u043d\u0435\u0442 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/i> \u0432 \u0441\u043e\u0441\u0435\u0434\u043d\u0435\u043c \u0441\u043f\u0438\u0441\u043a\u0435 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c <i>\u0432 \u043b\u044e\u0431\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435<\/i>. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u043d\u0430\u0448\u0443 \u0441\u043b\u0443\u0436\u0431\u0443 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 <b>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c AppleScript<\/b> \u0438 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"ruby\">set appName to &quot;Skype&quot; set startIt to false tell application &quot;System Events&quot;     if not (exists process appName) then         set startIt to true     else if frontmost of process appName then         set visible of process appName to false     else         set frontmost of process appName to true     end if end tell if startIt then     tell application appName to activate end if <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442<\/b><\/p>\n<div class=\"spoiler_text\"> <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/e4b\/da9\/98a\/e4bda998a66956be75ee9d10b8f627c7.png\"\/>  <\/div>\n<\/div>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0447\u0435\u0441\u0442\u043d\u043e \u043f\u043e\u0437\u0430\u0438\u043c\u0441\u0442\u0432\u043e\u0432\u0430\u043d <a href=\"http:\/\/brettterpstra.com\/2011\/01\/22\/quick-tip-applescript-application-toggle\/\">\u043e\u0442\u0441\u044e\u0434\u0430<\/a>.<br \/>  \u0417\u0434\u0435\u0441\u044c \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e: \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043e \u043b\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0435\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0435\u0433\u043e, \u0438\u043d\u0430\u0447\u0435 \u043b\u0438\u0431\u043e \u0441\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0435\u0433\u043e (\u0435\u0441\u043b\u0438 \u043e\u043a\u043d\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0444\u043e\u043a\u0443\u0441\u0435), \u043b\u0438\u0431\u043e \u043e\u0442\u0434\u0430\u0435\u0442 \u0435\u043c\u0443 \u0444\u043e\u043a\u0443\u0441 (\u0435\u0441\u043b\u0438 \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0434\u0440\u0443\u0433\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435).<\/p>\n<p>  \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043d\u0430\u0448\u0443 \u0441\u043b\u0443\u0436\u0431\u0443, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 <b>\u0421\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 &gt; \u041a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u0430 &gt; \u0421\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0432\u0438\u0448<\/b> \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0441\u043b\u0435\u0432\u0430 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c <b>\u0421\u043b\u0443\u0436\u0431\u044b<\/b>, \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0441\u043f\u0440\u0430\u0432\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0443\u044e \u043d\u0430\u043c\u0438 \u0441\u043b\u0443\u0436\u0431\u0443 \u0438 \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u043c \u043a \u043d\u0435\u0439 \u0445\u043e\u0442\u043a\u0435\u0439. \u0426\u0435\u043b\u044c \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442\u0430, \u043e\u0434\u043d\u0430\u043a\u043e \u0431\u0435\u0437 \u043e\u0434\u043d\u043e\u0433\u043e <i>\u043d\u043e<\/i> \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u043e\u0431\u043e\u0439\u0434\u0435\u0442\u0441\u044f.<\/p>\n<p>  \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u044b\u0437\u043e\u0432 \u0441\u043b\u0443\u0436\u0431\u044b \u043d\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0445\u043e\u0442\u043a\u0435\u044e. \u0421\u043b\u0443\u0436\u0431\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0438\u0437 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u00ab\u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u00bb. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430\u0445\u043e\u0434\u044f\u0441\u044c \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432 Safari, \u0432 \u043c\u0435\u043d\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043c\u044b \u043d\u0430\u0439\u0434\u0435\u043c \u043f\u043e\u0434\u043c\u0435\u043d\u044e <b>\u0421\u043b\u0443\u0436\u0431\u044b<\/b> (\u0442.\u0435. <i>Safari &gt; \u0421\u043b\u0443\u0436\u0431\u044b<\/i>), \u0433\u0434\u0435 \u043d\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u043d\u0430\u0448\u0430 \u0441\u043b\u0443\u0436\u0431\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0435\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0438\u0437 \u043b\u044e\u0431\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0430 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0439 \u043d\u0430\u043c\u0438 \u0445\u043e\u0442\u043a\u0435\u0439 \u0438\u043c\u0435\u0435\u0442 \u043c\u0435\u043d\u044c\u0448\u0438\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041e\u0442\u0441\u044e\u0434\u0430 \u0438\u043c\u0435\u0435\u043c \u0434\u0432\u0430 \u0432\u044b\u0445\u043e\u0434\u0430: \u043b\u0438\u0431\u043e \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u043d\u0430\u0448\u0435\u0439 \u0441\u043b\u0443\u0436\u0431\u044b \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0432\u0438\u0448, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0438\u0433\u0434\u0435 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u043d\u0438 \u0432 \u043e\u0434\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435, \u043b\u0438\u0431\u043e \u043f\u0440\u0438\u0431\u0435\u0433\u043d\u0443\u0442\u044c \u043a \u043f\u043e\u043c\u043e\u0449\u0438 <a href=\"http:\/\/superuser.com\/a\/309144\">\u0442\u0435\u0445 \u0441\u0430\u043c\u044b\u0445<\/a> \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0430\u0434\u0443\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0432\u0435\u0441\u0438\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0445\u043e\u0442\u043a\u0435\u0439 \u043d\u0430 \u0432\u044b\u0437\u043e\u0432 \u0441\u043b\u0443\u0436\u0431\u044b. \u041b\u0438\u0447\u043d\u043e \u044f \u043f\u043e\u0448\u0435\u043b \u043f\u043e \u0442\u0440\u0435\u0442\u044c\u0435\u043c\u0443 \u043f\u0443\u0442\u0438 \u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438 Alfred, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0435 \u043f\u0440\u0438\u0431\u0435\u0433\u0430\u0442\u044c \u043a \u0432\u044b\u0448\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u043c \u0438 \u0434\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0438 \u0441\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044e \u043d\u0430 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0439 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0445\u043e\u0442\u043a\u0435\u0439.<\/p>\n<h2>\u0427\u0442\u043e \u0442\u0430\u043c \u0441 \u0430\u0432\u0442\u043e\u0445\u0430\u0439\u0434\u0438\u043d\u0433\u043e\u043c?<\/h2>\n<p>  \u0418\u0442\u0430\u043a, \u043c\u044b \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0438 \u0441\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044e \u043d\u0430 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0445\u043e\u0442\u043a\u0435\u0439, \u043d\u043e \u0436\u0430\u0442\u044c \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u0432 \u0434\u0440\u0443\u0433\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043d\u0430\u043f\u0440\u044f\u0436\u043d\u043e. \u0420\u0435\u0448\u0438\u043c \u0438 \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443.<\/p>\n<p>  \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c <b>\u0420\u0435\u0434\u0430\u043a\u0442\u043e\u0440 AppleScript<\/b> \u0438 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"ruby\">property appName : &quot;Skype&quot;  on idle     tell application &quot;System Events&quot;         set focusedApp to (name of the first process whose frontmost is true)         if (focusedApp is not appName) and (exists process appName) and (visible of process appName) then             set visible of process appName to false         end if     end tell     return 0.5 end idle <\/code><\/pre>\n<p>  \u0416\u043c\u0435\u043c <b>\u0424\u0430\u0439\u043b &gt; \u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c<\/b>, \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c <i>\u0444\u043e\u0440\u043c\u0430\u0442 \u0444\u0430\u0439\u043b\u0430<\/i> \u2014 <b>\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430<\/b>, \u0441\u0442\u0430\u0432\u0438\u043c \u0433\u0430\u043b\u043a\u0443 \u0440\u044f\u0434\u043e\u043c \u0441 <b>\u041e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430<\/b>, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0430 <b>\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u0430<\/b>, \u043d\u0430\u0436\u0430\u0432 \u043d\u0430 \u043d\u0435\u0435, \u0441\u043f\u0440\u0430\u0432\u0430 \u0432\u044b\u043f\u043e\u043b\u0437\u0435\u0442 \u043e\u043a\u043d\u043e, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0438\u0449\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0443 \u0441 \u0448\u0435\u0441\u0442\u0435\u0440\u043d\u0435\u0439, \u0432 \u043f\u043e\u044f\u0432\u0438\u0432\u0448\u0435\u043c\u0441\u044f \u043c\u0435\u043d\u044e \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c <b>\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432 Finder<\/b>:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442<\/b><\/p>\n<div class=\"spoiler_text\"> <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/598\/101\/6d1\/5981016d18afca6ce4024b4726758418.png\"\/><\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/b65\/b0c\/18c\/b65b0c18ca7958fa545b1f820e4c6a49.png\"\/>  <\/div>\n<\/div>\n<p>  \u0412 \u043e\u0442\u043a\u0440\u044b\u0432\u0448\u0435\u0439\u0441\u044f \u043f\u0430\u043f\u043a\u0435 \u0431\u0443\u0434\u0435\u0442 \u043b\u0435\u0436\u0430\u0442\u044c \u0444\u0430\u0439\u043b <b>Info.plist<\/b>, \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u0432 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c:<\/p>\n<pre><code class=\"xml\">&lt;key&gt;LSBackgroundOnly&lt;\/key&gt; &lt;string&gt;1&lt;\/string&gt; <\/code><\/pre>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412\u043e\u0442, \u0447\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;!DOCTYPE plist PUBLIC &quot;-\/\/Apple\/\/DTD PLIST 1.0\/\/EN&quot; &quot;http:\/\/www.apple.com\/DTDs\/PropertyList-1.0.dtd&quot;&gt; &lt;plist version=&quot;1.0&quot;&gt; &lt;dict&gt;     &lt;key&gt;LSBackgroundOnly&lt;\/key&gt;     &lt;string&gt;1&lt;\/string&gt;     &lt;key&gt;CFBundleAllowMixedLocalizations&lt;\/key&gt;     &lt;true\/&gt;     &lt;key&gt;CFBundleDevelopmentRegion&lt;\/key&gt;     &lt;string&gt;English&lt;\/string&gt;     &lt;key&gt;CFBundleExecutable&lt;\/key&gt;     &lt;string&gt;applet&lt;\/string&gt;     &lt;key&gt;CFBundleIconFile&lt;\/key&gt;     &lt;string&gt;applet&lt;\/string&gt;     &lt;key&gt;CFBundleIdentifier&lt;\/key&gt;     &lt;string&gt;com.apple.ScriptEditor.id.HideSkype&lt;\/string&gt;     &lt;key&gt;CFBundleInfoDictionaryVersion&lt;\/key&gt;     &lt;string&gt;6.0&lt;\/string&gt;     &lt;key&gt;CFBundleName&lt;\/key&gt;     &lt;string&gt;HideSkype&lt;\/string&gt;     &lt;key&gt;CFBundlePackageType&lt;\/key&gt;     &lt;string&gt;APPL&lt;\/string&gt;     &lt;key&gt;CFBundleShortVersionString&lt;\/key&gt;     &lt;string&gt;1.0&lt;\/string&gt;     &lt;key&gt;CFBundleSignature&lt;\/key&gt;     &lt;string&gt;aplt&lt;\/string&gt;     &lt;key&gt;LSMinimumSystemVersionByArchitecture&lt;\/key&gt;     &lt;dict&gt;         &lt;key&gt;x86_64&lt;\/key&gt;         &lt;string&gt;10.6&lt;\/string&gt;     &lt;\/dict&gt;     &lt;key&gt;LSRequiresCarbon&lt;\/key&gt;     &lt;true\/&gt;     &lt;key&gt;WindowState&lt;\/key&gt;     &lt;dict&gt;         &lt;key&gt;dividerCollapsed&lt;\/key&gt;         &lt;false\/&gt;         &lt;key&gt;eventLogLevel&lt;\/key&gt;         &lt;integer&gt;2&lt;\/integer&gt;         &lt;key&gt;name&lt;\/key&gt;         &lt;string&gt;ScriptWindowState&lt;\/string&gt;         &lt;key&gt;positionOfDivider&lt;\/key&gt;         &lt;real&gt;333&lt;\/real&gt;         &lt;key&gt;savedFrame&lt;\/key&gt;         &lt;string&gt;55 281 602 597 0 0 1440 878 &lt;\/string&gt;         &lt;key&gt;selectedTabView&lt;\/key&gt;         &lt;string&gt;event log&lt;\/string&gt;     &lt;\/dict&gt; &lt;\/dict&gt; &lt;\/plist&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0444\u0430\u0439\u043b.<\/p>\n<p>  \u0412\u043e\u0442 \u0438 \u0432\u0441\u0435, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0438 \u0440\u0430\u0434\u0443\u0435\u043c\u0441\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u043c\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0443. \u041e\u0442\u043d\u044b\u043d\u0435 \u0441\u043a\u0430\u0439\u043f \u0433\u043b\u0430\u0437\u0430 \u043d\u0435 \u043c\u043e\u0437\u043e\u043b\u0438\u0442.<br \/>  \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0442\u043e \u0447\u0438\u0442\u0430\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<h2>\u0420\u0430\u0437\u0431\u043e\u0440 \u043f\u043e\u043b\u0435\u0442\u043e\u0432<\/h2>\n<p>  AppleScript \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0435\u043c, \u0442\u0430\u043a \u0447\u0442\u043e \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u043f\u0430\u0440\u0443 \u0434\u043d\u0435\u0439 \u043d\u0430\u0437\u0430\u0434 \u044f \u0438 \u043d\u0435 \u0437\u043d\u0430\u043b \u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u00ab\u0447\u0443\u0434\u0430\u00bb (\u0443\u0436 \u043e\u0447\u0435\u043d\u044c \u043e\u043d \u0441\u043c\u0430\u0445\u0438\u0432\u0430\u0435\u0442 \u043d\u0430 \u044f\u0437\u044b\u043a \u0434\u043b\u044f \u0434\u043e\u043c\u043e\u0445\u043e\u0437\u044f\u0435\u043a). \u0417\u0430\u0442\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0432 \u0432\u0430\u0448\u0435\u043c \u0440\u0430\u0431\u043e\u0447\u0435\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438. \u0414\u043b\u044f \u0432\u044b\u0448\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u0430\u0441\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430, \u0430 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u043c\u043e\u0436\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u043c\u043e\u0449\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u0434 \u0440\u0443\u043a\u043e\u0439.<\/p>\n<p>  \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u0440\u0430\u0437\u043b\u043e\u0436\u0438\u0442\u044c \u043f\u043e \u043f\u043e\u043b\u043e\u0447\u043a\u0430\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u0440\u043e \u0430\u0432\u0442\u043e\u0441\u043a\u0440\u044b\u0442\u0438\u044e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0443\u0447\u0438\u043c\u0441\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c, \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043b\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0444\u043e\u043a\u0443\u0441\u0435, \u0438\u043b\u0438 \u043d\u0435\u0442:<\/p>\n<pre><code class=\"ruby\">set appName to &quot;Skype&quot; --\u0434\u0443\u043c\u0430\u044e, \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043d\u0435 \u0443\u043c\u0435\u0441\u0442\u043d\u044b tell application &quot;System Events&quot; --\u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c application, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439 System Events     set focusedApp to (name of the first process whose frontmost is true) --\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 focusedApp \u0438\u043c\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432 \u0444\u043e\u043a\u0443\u0441\u0435     if focusedApp is appName then         --\u0432\u043e\u0442 \u0438 \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u0438, \u0447\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c appName \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0444\u043e\u043a\u0443\u0441\u0435     end if end tell <\/code><\/pre>\n<p>  \u041e\u0447\u0435\u043d\u044c \u043d\u0435\u043f\u0440\u0438\u0432\u044b\u0447\u043d\u043e \u0447\u0438\u0442\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434, \u0437\u0430\u0442\u043e \u043f\u0440\u0438\u044f\u0442\u043d\u043e \u2014 \u0441\u043e\u043c\u043e\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0444\u043e\u043a\u0443\u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u0442\u0435\u0440\u044f\u043d, \u0442\u043e \u0441\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e:<\/p>\n<pre><code class=\"ruby\">set appName to &quot;Skype&quot; tell application &quot;System Events&quot;     set focusedApp to (name of the first process whose frontmost is true)     if (focusedApp is not appName) and (exists process appName) and (visible of process appName) then         set visible of process appName to false     end if end tell <\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0435\u0433\u043e \u0432 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0446\u0438\u043a\u043b.<\/p>\n<pre><code class=\"ruby\">set appName to &quot;Skype&quot; repeat while true     tell application &quot;System Events&quot;         set focusedApp to (name of the first process whose frontmost is true)         if (focusedApp is not appName) and (exists process appName) and (visible of process appName) then             set visible of process appName to false         end if     end tell     delay 0.5 --\u0434\u0435\u043b\u0430\u0435\u043c \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0443 \u0432 \u043f\u043e\u043b \u0441\u0435\u043a\u0443\u043d\u0434\u044b \u043f\u0435\u0440\u0435\u0434 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0435\u0439 end repeat <\/code><\/pre>\n<p>  \u0418 \u044d\u0442\u043e \u0443\u0436\u0435 \u0440\u0430\u0431\u043e\u0447\u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0435\u0433\u043e \u0432 \u0442\u0430\u043a\u043e\u043c \u0432\u0438\u0434\u0435, \u0442\u043e \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0440\u043e\u0441\u0442\u043e-\u043d\u0430\u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u0432\u0438\u0441\u043d\u0435\u0442, \u0445\u043e\u0442\u044c \u0438 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u2014 \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0446\u0438\u043a\u043b \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0442\u043e\u043a. \u041d\u043e \u0443\u0432\u044b, \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0432 AppleScript \u043d\u0435\u0442. \u0418\u0434\u0435\u043c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0445\u044d\u043d\u0434\u043b\u0435\u0440 <b>idle<\/b>. \u0425\u044d\u043d\u0434\u043b\u0435\u0440\u0430\u043c\u0438 \u0432 AppleScript \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f, \u043f\u043e \u0441\u0443\u0442\u0438, \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0435 \u043d\u0430\u043c \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0445\u044d\u043d\u0434\u043b\u0435\u0440\u0430 idle \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u043a\u0430\u0436\u0434\u044b\u0435 30 \u0441\u0435\u043a\u0443\u043d\u0434, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0435\u0441\u043b\u0438 \u0436\u0435 \u043e\u043d \u0432\u0435\u0440\u043d\u0435\u0442, \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c, 5, \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u0435 5 \u0441\u0435\u043a\u0443\u043d\u0434.<\/p>\n<pre><code class=\"ruby\">on idle     set appName to &quot;Skype&quot;     tell application &quot;System Events&quot;         set focusedApp to (name of the first process whose frontmost is true)         if (focusedApp is not appName) and (exists process appName) and (visible of process appName) then             set visible of process appName to false         end if     end tell     return 0.5 end idle <\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f idle \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0445\u0435\u043d\u0434\u043b\u0435\u0440\u0430\u043c\u0438 <b>run<\/b> \u0438 <b>quit<\/b>:<\/p>\n<pre><code class=\"ruby\">property appName: &quot;Skype&quot; property running: true  on run     repeat while running         tell application &quot;System Events&quot;             set focusedApp to (name of the first process whose frontmost is true)             if (focusedApp is not appName) and (exists process appName) and (visible of process appName) then                 set visible of process appName to false             end if         end tell         delay 1     end repeat end run  on quit     set running to false end quit <\/code><\/pre>\n<h2>\u0425\u043e\u0447\u0443 \u043e\u0434\u0438\u043d \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0434\u043b\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c<\/h2>\n<p>  \u0414\u0430 \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c:<\/p>\n<pre><code class=\"ruby\">property appsToHide: {&quot;Skype&quot;, &quot;Adium&quot;, &quot;Sublime Text 2&quot;}  on idle     tell application &quot;System Events&quot;         set focusedApp to name of the first process whose frontmost is true         repeat with appToHide in appsToHide             if (focusedApp is not in appToHide) and (exists process appToHide) and (visible of process appToHide) then                 set visible of process appToHide to false             end if         end repeat     end tell     return 0.5 end idle <\/code><\/pre>\n<p>  \u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442: <code>focusedApp is not in appToHide<\/code>. \u0417\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f, \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>focusedApp<\/code> \u0432 <code>appToHide<\/code>, \u0445\u043e\u0442\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0431\u044b \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0438 (\u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b <code>=, is equal, equals, [is] equal to, is not isn't, isn't equal [to], is not equal [to], doesn't equal, does not equal<\/code>). \u041d\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 (\u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445 <code>text<\/code>) \u0442\u0430\u043a \u0438 \u043d\u0435 \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u044f \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044e \u0441\u0432\u043e\u0439 \u0440\u0430\u0441\u0441\u043a\u0430\u0437. \u041c\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0435\u0439 \u043e\u0431 AppleScript \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/developer.apple.com\/library\/mac\/documentation\/AppleScript\/Conceptual\/AppleScriptLangGuide\/introduction\/ASLR_intro.html#\/\/apple_ref\/doc\/uid\/TP40000983\">\u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>. \u0415\u0441\u043b\u0438 \u043a\u0442\u043e \u0441\u043e\u043c\u043d\u0435\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430, \u0442\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0432 <a href=\"https:\/\/developer.apple.com\/library\/mac\/releasenotes\/AppleScript\/RN-AppleScript\/Introduction\/Introduction.html#\/\/apple_ref\/doc\/uid\/TP40000982-CH1-SW1\">release notes<\/a> \u2014 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u044f\u0437\u044b\u043a\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u044e\u0442 \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u0440\u0435\u043b\u0438\u0437\u043e\u043c OS X. \u0422\u0430\u043a\u0436\u0435 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u0438\u043a\u0438 \u043f\u0435\u0441\u0442\u0440\u044f\u0442 \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u043c\u0438 howto \u043f\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044e \u0437\u0430\u0434\u0430\u0447 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e AppleScript.<\/p>\n<p>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435. \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/202864\/\"> http:\/\/habrahabr.ru\/post\/202864\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u041a\u0430\u043a \u0447\u0430\u0441\u0442\u043e \u0432\u044b \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435\u0441\u044c \u043e\u043f\u0446\u0438\u044f\u043c\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c (iTerm 2, Total Finder, Adium), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u043a\u043d\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044e \u043d\u0430 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0445\u043e\u0442\u043a\u0435\u0439 \u0438 \u0441\u043a\u0440\u044b\u0442\u044c \u044d\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u043f\u043e\u0442\u0435\u0440\u0435 \u0444\u043e\u043a\u0443\u0441\u0430? \u041b\u0438\u0447\u043d\u043e \u044f \u2014 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e. \u0410 \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043d\u0435\u043a\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0442\u0430\u043a\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u0438 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043c\u0430\u044f\u0447\u0438\u0442 \u043f\u0435\u0440\u0435\u0434 \u0433\u043b\u0430\u0437\u0430\u043c\u0438? \u0422\u043e\u0442 \u0436\u0435 Skype, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440. \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0432 \u043f\u043e\u0440\u044f\u0434\u043e\u043a.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-202864","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/202864","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=202864"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/202864\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=202864"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=202864"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=202864"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}