tag:blogger.com,1999:blog-41794587875332398152024-03-06T01:56:55.482+01:00iElkAnonymoushttp://www.blogger.com/profile/02122110458441117948noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-4179458787533239815.post-32008479115211315092017-02-01T22:51:00.001+01:002017-02-10T11:09:23.393+01:00Blurry font issue with Wine 2.0 on macOS 10.12.2After installing the <a href="https://dl.winehq.org/wine-builds/macosx/download.html" target="_blank">latest Wine release</a>, which currently is 2.0 (I chose the development branch) on <a href="https://www.xquartz.org/" target="_blank">XQuartz 2.7.11</a>, I was having problems with blurry text in both winecfg, regedit and other programs launched through Wine.<br />
After trying to enable font smoothing and font replacements (<a href="http://askubuntu.com/questions/219791/improve-gui-appearance-of-wine-applications" target="_blank">source</a>) with only slight changes I found someone trying to solve the same issues (<a href="http://mybyways.com/blog/compiling-wine-from-scratch-on-macos-with-retina-mode" target="_blank">source</a>), albeit compiling everything from scratch which I don't want to do.<br />
It turns out that the Retina display on my MacBook Pro was causing the issues with blurry fonts because Wine was not using the "real" resolution, only the reported "lower resolution".<br />
<br />
To enable Retina support in Wine open the registry editor via a terminal, preferably through Wine Devel.app installed with Wine:<br />
<span style="font-family: "courier new" , "courier" , monospace;">$</span><span style="font-family: "courier new" , "courier" , monospace;"> </span><span style="font-family: "courier new" , "courier" , monospace;">wine regedit</span><br />
<br />
Then find the folder/key:<br />
<span style="font-family: "courier new" , "courier" , monospace;">HKEY_CURRENT_USER\Software\</span><br />
<br />
I then had to create the folder/key called "Mac Driver" and inside the new folder/key create a new string value called RetinaMode. Now edit the value of the RetinaMode to be "y".<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfmx9Ja1XNPuSB3GtROlwEcJCibAR8z8DPBCk94QWL24zBeSL8W1i7KU6PJNB1BqNe4yYCCbAcgUEHF34BGG2eueFhyqs__P105NJDKeuzXf3UGkz9frFlsa7NBnDHoZ7MnDis7X2oX4c/s1600/regedit.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="497" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfmx9Ja1XNPuSB3GtROlwEcJCibAR8z8DPBCk94QWL24zBeSL8W1i7KU6PJNB1BqNe4yYCCbAcgUEHF34BGG2eueFhyqs__P105NJDKeuzXf3UGkz9frFlsa7NBnDHoZ7MnDis7X2oX4c/s640/regedit.png" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Picture showing the location of the new value to enable Retina support for Wine on macOS.<br />
Path is: <span style="font-family: "courier new" , "courier" , monospace;">HKEY_CURRENT_USER\Software\Wine\Mac Driver\</span></td></tr>
</tbody></table>
Close the registry editor and restart wine:<br />
<span style="font-family: "courier new" , "courier" , monospace;">$</span><span style="font-family: "courier new" , "courier" , monospace;"> </span><span style="font-family: "courier new" , "courier" , monospace;">wineboot</span><br />
Then open Wine configuration dialog:<br />
<span style="font-family: "courier new" , "courier" , monospace;">$ winecfg</span><br />
The window will now be very small due to Retina support being enabled. Navigate to Graphics and select a screen resolution scaling of 220 dpi.<br />
Close the Wine configuration dialog and restart wine again:<br />
<span style="font-family: "courier new" , "courier" , monospace;">$ wineboot</span><br />
<br />
That's it, next time you open a program (e.g. Wine configuration dialog) it will be the correct size and with smooth fonts.<br />
The windows terminal that is launched by:<br />
<span style="font-family: "courier new" , "courier" , monospace;">$ wineconsole</span><br />
Uses other font/scaling settings so it is necessary to choose another font size by right clicking the program and navigating to properties. Then select Font and choose a font size larger than 28, remember to select "retain the for later sessions" to save the settings for new windows.<br />
<br />Anonymoushttp://www.blogger.com/profile/02122110458441117948noreply@blogger.com10tag:blogger.com,1999:blog-4179458787533239815.post-64398274052633599872017-01-05T01:32:00.001+01:002017-02-10T11:09:32.938+01:00Applescript control of bluetooth and wifi - ADVANCEDI made a more advanced script for controlling (not flipping) the bluetooth and wifi power states (see previous post for finding the correct menus).<br />
This script is looking for a certain USB device that will indicate whether the computer is docked or not.<br />
<br />
<br />
<div style="color: #5f6060; font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 39.2px; text-indent: -39.3px;">
<span style="font-variant-ligatures: no-common-ligatures;">-- Applescript that searches connected USB devices and determines if this means the computer is docked or not.</span></div>
<div style="color: #5f6060; font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 39.2px; text-indent: -39.3px;">
<span style="font-variant-ligatures: no-common-ligatures;">-- In docked mode bluetooth should be On and wifi Off, and vice versa for undocked.</span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 39.2px; min-height: 15px; text-indent: -39.3px;">
<span style="font-variant-ligatures: no-common-ligatures;"></span><br /></div>
<div style="color: #5f6060; font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 39.2px; text-indent: -39.3px;">
<span style="font-variant-ligatures: no-common-ligatures;">------- BEGIN USER CONFIG -------</span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 39.2px; text-indent: -39.3px;">
<span style="font-variant-ligatures: no-common-ligatures;"><b>set</b> </span><span style="color: #4e8f00; font-variant-ligatures: no-common-ligatures;">list_cmd</span><span style="font-variant-ligatures: no-common-ligatures;"> <b>to</b> "system_profiler SPUSBDataType"</span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 39.2px; text-indent: -39.3px;">
<span style="font-variant-ligatures: no-common-ligatures;"><b>set</b> </span><span style="color: #4e8f00; font-variant-ligatures: no-common-ligatures;">search_str</span><span style="font-variant-ligatures: no-common-ligatures;"> <b>to</b> "AX80_EXT_HUB"</span></div>
<div style="color: #5f6060; font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 39.2px; text-indent: -39.3px;">
<span style="font-variant-ligatures: no-common-ligatures;">-------- END USER CONFIG --------</span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 39.2px; min-height: 15px; text-indent: -39.3px;">
<span style="font-variant-ligatures: no-common-ligatures;"></span><br /></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 39.2px; min-height: 15px; text-indent: -39.3px;">
<span style="font-variant-ligatures: no-common-ligatures;"></span><br /></div>
<div style="color: #5f6060; font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 39.2px; text-indent: -39.3px;">
<span style="font-variant-ligatures: no-common-ligatures;">---------- BEGIN SCRIPT ----------</span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 39.2px; text-indent: -39.3px;">
<span style="font-variant-ligatures: no-common-ligatures;"><b>set</b> </span><span style="color: #4e8f00; font-variant-ligatures: no-common-ligatures;">shellOut</span><span style="font-variant-ligatures: no-common-ligatures;"> <b>to</b> ""</span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 39.2px; text-indent: -39.3px;">
<span style="font-variant-ligatures: no-common-ligatures;"><b>try</b></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 78.5px; text-indent: -78.6px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>set</b> </span><span style="color: #4e8f00; font-variant-ligatures: no-common-ligatures;">shellOut</span><span style="font-variant-ligatures: no-common-ligatures;"> <b>to</b> </span><span style="color: #012fbe; font-variant-ligatures: no-common-ligatures;"><b>do shell script</b></span><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="color: #4e8f00; font-variant-ligatures: no-common-ligatures;">list_cmd</span><span style="font-variant-ligatures: no-common-ligatures;"> & " | grep " & </span><span style="color: #812fdc; font-variant-ligatures: no-common-ligatures;">quoted form</span><span style="font-variant-ligatures: no-common-ligatures;"> <b>of</b> </span><span style="color: #4e8f00; font-variant-ligatures: no-common-ligatures;">search_str</span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 39.2px; text-indent: -39.3px;">
<span style="font-variant-ligatures: no-common-ligatures;"><b>end</b> <b>try</b></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 39.2px; text-indent: -39.3px;">
<span style="font-variant-ligatures: no-common-ligatures;"><b>if</b> </span><span style="color: #4e8f00; font-variant-ligatures: no-common-ligatures;">shellOut</span><span style="font-variant-ligatures: no-common-ligatures;"> <b>contains</b> </span><span style="color: #4e8f00; font-variant-ligatures: no-common-ligatures;">search_str</span><span style="font-variant-ligatures: no-common-ligatures;"> <b>then</b></span></div>
<div style="color: #4e8f00; font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 78.5px; text-indent: -78.6px;">
<span style="color: black; font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>set</b> </span><span style="font-variant-ligatures: no-common-ligatures;">state_docked</span><span style="color: black; font-variant-ligatures: no-common-ligatures;"> <b>to</b> </span><span style="color: #812fdc; font-variant-ligatures: no-common-ligatures;"><i>true</i></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 39.2px; text-indent: -39.3px;">
<span style="font-variant-ligatures: no-common-ligatures;"><b>else</b></span></div>
<div style="color: #4e8f00; font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 78.5px; text-indent: -78.6px;">
<span style="color: black; font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>set</b> </span><span style="font-variant-ligatures: no-common-ligatures;">state_docked</span><span style="color: black; font-variant-ligatures: no-common-ligatures;"> <b>to</b> </span><span style="color: #812fdc; font-variant-ligatures: no-common-ligatures;"><i>false</i></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 39.2px; text-indent: -39.3px;">
<span style="font-variant-ligatures: no-common-ligatures;"><b>end</b> <b>if</b></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 39.2px; min-height: 15px; text-indent: -39.3px;">
<span style="font-variant-ligatures: no-common-ligatures;"></span><br /></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 39.2px; text-indent: -39.3px;">
<span style="font-variant-ligatures: no-common-ligatures;"><b>if</b> </span><span style="color: #4e8f00; font-variant-ligatures: no-common-ligatures;">state_docked</span><span style="font-variant-ligatures: no-common-ligatures;"> <b>is</b> </span><span style="color: #812fdc; font-variant-ligatures: no-common-ligatures;"><i>true</i></span><span style="font-variant-ligatures: no-common-ligatures;"> <b>then</b></span></div>
<div style="color: #4e8f00; font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 78.5px; text-indent: -78.6px;">
<span style="color: black; font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>set</b> </span><span style="font-variant-ligatures: no-common-ligatures;">state_bluetooth</span><span style="color: black; font-variant-ligatures: no-common-ligatures;"> <b>to</b> "On"</span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 78.5px; text-indent: -78.6px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>set</b> </span><span style="color: #4e8f00; font-variant-ligatures: no-common-ligatures;">state_wifi</span><span style="font-variant-ligatures: no-common-ligatures;"> <b>to</b> "Off"</span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 39.2px; text-indent: -39.3px;">
<span style="font-variant-ligatures: no-common-ligatures;"><b>else</b></span></div>
<div style="color: #4e8f00; font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 78.5px; text-indent: -78.6px;">
<span style="color: black; font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>set</b> </span><span style="font-variant-ligatures: no-common-ligatures;">state_bluetooth</span><span style="color: black; font-variant-ligatures: no-common-ligatures;"> <b>to</b> "Off"</span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 78.5px; text-indent: -78.6px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>set</b> </span><span style="color: #4e8f00; font-variant-ligatures: no-common-ligatures;">state_wifi</span><span style="font-variant-ligatures: no-common-ligatures;"> <b>to</b> "On"</span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 39.2px; text-indent: -39.3px;">
<span style="font-variant-ligatures: no-common-ligatures;"><b>end</b> <b>if</b></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 39.2px; min-height: 15px; text-indent: -39.3px;">
<span style="font-variant-ligatures: no-common-ligatures;"></span><br /></div>
<div style="color: #4e8f00; font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 39.2px; text-indent: -39.3px;">
<span style="color: black; font-variant-ligatures: no-common-ligatures;"><b>set</b> </span><span style="font-variant-ligatures: no-common-ligatures;">menu_bluetooth</span><span style="color: black; font-variant-ligatures: no-common-ligatures;"> <b>to</b> 0</span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 39.2px; text-indent: -39.3px;">
<span style="font-variant-ligatures: no-common-ligatures;"><b>set</b> </span><span style="color: #4e8f00; font-variant-ligatures: no-common-ligatures;">menu_wifi</span><span style="font-variant-ligatures: no-common-ligatures;"> <b>to</b> 0</span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 39.2px; text-indent: -39.3px;">
<span style="font-variant-ligatures: no-common-ligatures;"><b>tell</b> </span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><i>application</i></span><span style="font-variant-ligatures: no-common-ligatures;"> "System Events" <b>to</b> <b>tell</b> <b>the</b> <b>front</b> </span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><i>menu bar</i></span><span style="font-variant-ligatures: no-common-ligatures;"> <b>of</b> </span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><i>process</i></span><span style="font-variant-ligatures: no-common-ligatures;"> "SystemUIServer"</span></div>
<div style="color: #0433ff; font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 78.5px; text-indent: -78.6px;">
<span style="color: black; font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>set</b> </span><span style="color: #4e8f00; font-variant-ligatures: no-common-ligatures;">menu_extras</span><span style="color: black; font-variant-ligatures: no-common-ligatures;"> <b>to</b> </span><span style="color: #812fdc; font-variant-ligatures: no-common-ligatures;">description</span><span style="color: black; font-variant-ligatures: no-common-ligatures;"> <b>of</b> </span><span style="font-variant-ligatures: no-common-ligatures;"><i>menu bar items</i></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 78.5px; text-indent: -78.6px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>repeat</b> <b>with</b> </span><span style="color: #4e8f00; font-variant-ligatures: no-common-ligatures;">x</span><span style="font-variant-ligatures: no-common-ligatures;"> <b>from</b> 1 <b>to</b> <b>the</b> </span><span style="color: #812fdc; font-variant-ligatures: no-common-ligatures;">length</span><span style="font-variant-ligatures: no-common-ligatures;"> <b>of</b> </span><span style="color: #4e8f00; font-variant-ligatures: no-common-ligatures;">menu_extras</span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 117.8px; text-indent: -117.8px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>if</b> </span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><i>item</i></span><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="color: #4e8f00; font-variant-ligatures: no-common-ligatures;">x</span><span style="font-variant-ligatures: no-common-ligatures;"> <b>of</b> </span><span style="color: #4e8f00; font-variant-ligatures: no-common-ligatures;">menu_extras</span><span style="font-variant-ligatures: no-common-ligatures;"> <b>is</b> "bluetooth" <b>then</b></span></div>
<div style="color: #4e8f00; font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 157.1px; text-indent: -157.2px;">
<span style="color: black; font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>set</b> </span><span style="font-variant-ligatures: no-common-ligatures;">menu_bluetooth</span><span style="color: black; font-variant-ligatures: no-common-ligatures;"> <b>to</b> </span><span style="font-variant-ligatures: no-common-ligatures;">x</span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 157.1px; text-indent: -157.2px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>exit</b> <b>repeat</b></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 117.8px; text-indent: -117.8px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>end</b> <b>if</b></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 78.5px; text-indent: -78.6px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>end</b> <b>repeat</b></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 78.5px; text-indent: -78.6px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>repeat</b> <b>with</b> </span><span style="color: #4e8f00; font-variant-ligatures: no-common-ligatures;">x</span><span style="font-variant-ligatures: no-common-ligatures;"> <b>from</b> 1 <b>to</b> <b>the</b> </span><span style="color: #812fdc; font-variant-ligatures: no-common-ligatures;">length</span><span style="font-variant-ligatures: no-common-ligatures;"> <b>of</b> </span><span style="color: #4e8f00; font-variant-ligatures: no-common-ligatures;">menu_extras</span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 117.8px; text-indent: -117.8px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>if</b> </span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><i>item</i></span><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="color: #4e8f00; font-variant-ligatures: no-common-ligatures;">x</span><span style="font-variant-ligatures: no-common-ligatures;"> <b>of</b> </span><span style="color: #4e8f00; font-variant-ligatures: no-common-ligatures;">menu_extras</span><span style="font-variant-ligatures: no-common-ligatures;"> <b>starts with</b> "Wi-Fi" <b>then</b></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 157.1px; text-indent: -157.2px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>set</b> </span><span style="color: #4e8f00; font-variant-ligatures: no-common-ligatures;">menu_wifi</span><span style="font-variant-ligatures: no-common-ligatures;"> <b>to</b> </span><span style="color: #4e8f00; font-variant-ligatures: no-common-ligatures;">x</span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 157.1px; text-indent: -157.2px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>exit</b> <b>repeat</b></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 117.8px; text-indent: -117.8px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>end</b> <b>if</b></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 78.5px; text-indent: -78.6px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>end</b> <b>repeat</b></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 78.5px; min-height: 15px; text-indent: -78.6px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 78.5px; text-indent: -78.6px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>if</b> </span><span style="color: #4e8f00; font-variant-ligatures: no-common-ligatures;">menu_bluetooth</span><span style="font-variant-ligatures: no-common-ligatures;"> <b>is</b> <b>greater than</b> 0 <b>then</b></span></div>
<div style="color: #4e8f00; font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 117.8px; text-indent: -117.8px;">
<span style="color: black; font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>tell</b> </span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><i>menu bar item</i></span><span style="color: black; font-variant-ligatures: no-common-ligatures;"> </span><span style="font-variant-ligatures: no-common-ligatures;">menu_bluetooth</span></div>
<div style="color: #0433ff; font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 157.1px; text-indent: -157.2px;">
<span style="color: black; font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="font-variant-ligatures: no-common-ligatures;"><b>click</b></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 157.1px; text-indent: -157.2px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>if</b> </span><span style="color: #812fdc; font-variant-ligatures: no-common-ligatures;">name</span><span style="font-variant-ligatures: no-common-ligatures;"> <b>of</b> </span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><i>menu item</i></span><span style="font-variant-ligatures: no-common-ligatures;"> 2 <b>of</b> <b>front</b> </span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><i>menu</i></span><span style="font-variant-ligatures: no-common-ligatures;"> <b>ends with</b> </span><span style="color: #4e8f00; font-variant-ligatures: no-common-ligatures;">state_bluetooth</span><span style="font-variant-ligatures: no-common-ligatures;"> <b>then</b></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 196.4px; text-indent: -196.4px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>tell</b> </span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><i>menu item</i></span><span style="font-variant-ligatures: no-common-ligatures;"> 2 <b>of</b> <b>front</b> </span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><i>menu</i></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 235.7px; text-indent: -235.7px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><b>click</b></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 196.4px; text-indent: -196.4px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>end</b> <b>tell</b></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 157.1px; text-indent: -157.2px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>else</b></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 196.4px; text-indent: -196.4px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>tell</b> </span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><i>application</i></span><span style="font-variant-ligatures: no-common-ligatures;"> "System Events"</span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 235.7px; text-indent: -235.7px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><b>key code</b></span><span style="font-variant-ligatures: no-common-ligatures;"> 53</span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 196.4px; text-indent: -196.4px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>end</b> <b>tell</b></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 157.1px; text-indent: -157.2px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>end</b> <b>if</b></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 117.8px; text-indent: -117.8px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>end</b> <b>tell</b></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 78.5px; text-indent: -78.6px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>end</b> <b>if</b></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 78.5px; min-height: 15px; text-indent: -78.6px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 78.5px; min-height: 15px; text-indent: -78.6px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 78.5px; text-indent: -78.6px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>if</b> </span><span style="color: #4e8f00; font-variant-ligatures: no-common-ligatures;">menu_wifi</span><span style="font-variant-ligatures: no-common-ligatures;"> <b>is</b> <b>greater than</b> 0 <b>then</b></span></div>
<div style="color: #0433ff; font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 117.8px; text-indent: -117.8px;">
<span style="color: black; font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>tell</b> </span><span style="font-variant-ligatures: no-common-ligatures;"><i>menu bar item</i></span><span style="color: black; font-variant-ligatures: no-common-ligatures;"> </span><span style="color: #4e8f00; font-variant-ligatures: no-common-ligatures;">menu_wifi</span></div>
<div style="color: #0433ff; font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 157.1px; text-indent: -157.2px;">
<span style="color: black; font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="font-variant-ligatures: no-common-ligatures;"><b>click</b></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 157.1px; text-indent: -157.2px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>if</b> </span><span style="color: #812fdc; font-variant-ligatures: no-common-ligatures;">name</span><span style="font-variant-ligatures: no-common-ligatures;"> <b>of</b> </span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><i>menu item</i></span><span style="font-variant-ligatures: no-common-ligatures;"> 2 <b>of</b> <b>front</b> </span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><i>menu</i></span><span style="font-variant-ligatures: no-common-ligatures;"> <b>ends with</b> </span><span style="color: #4e8f00; font-variant-ligatures: no-common-ligatures;">state_wifi</span><span style="font-variant-ligatures: no-common-ligatures;"> <b>then</b></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 196.4px; text-indent: -196.4px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>tell</b> </span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><i>menu item</i></span><span style="font-variant-ligatures: no-common-ligatures;"> 2 <b>of</b> <b>front</b> </span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><i>menu</i></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 235.7px; text-indent: -235.7px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><b>click</b></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 196.4px; text-indent: -196.4px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>end</b> <b>tell</b></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 157.1px; text-indent: -157.2px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>else</b></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 196.4px; text-indent: -196.4px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>tell</b> </span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><i>application</i></span><span style="font-variant-ligatures: no-common-ligatures;"> "System Events"</span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 235.7px; text-indent: -235.7px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><b>key code</b></span><span style="font-variant-ligatures: no-common-ligatures;"> 53</span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 196.4px; text-indent: -196.4px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>end</b> <b>tell</b></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 157.1px; text-indent: -157.2px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>end</b> <b>if</b></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 117.8px; text-indent: -117.8px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>end</b> <b>tell</b></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 78.5px; text-indent: -78.6px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>end</b> <b>if</b></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 78.5px; min-height: 15px; text-indent: -78.6px;">
<span style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 39.2px; text-indent: -39.3px;">
<span style="font-variant-ligatures: no-common-ligatures;"><b>end</b> <b>tell</b></span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 39.2px; min-height: 15px; text-indent: -39.3px;">
<span style="font-variant-ligatures: no-common-ligatures;"></span><br /></div>
<br />
<div style="color: #5f6060; font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 39.2px; text-indent: -39.3px;">
<span style="font-variant-ligatures: no-common-ligatures;">----------- END SCRIPT -----------</span></div>
Anonymoushttp://www.blogger.com/profile/02122110458441117948noreply@blogger.com0tag:blogger.com,1999:blog-4179458787533239815.post-88272909722572635772017-01-04T23:22:00.002+01:002017-01-04T23:22:22.643+01:00Applescript control of bluetooth and wifiHere's a small script that will flip the state of both bluetooth and wifi radios on your Mac.<br />
It is tested on a macOS Sierra 10.12.2, and the descriptions ("bluetooth" and "Wi-Fi") may be altered in previous (or future) versions. Read on below if you need to change this.<br />
<br />
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 41.6px; text-indent: -41.6px;">
<span style="font-variant-ligatures: no-common-ligatures;"><b>tell</b> </span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><i>application</i></span><span style="font-variant-ligatures: no-common-ligatures;"> "System Events" <b>to</b> <b>tell</b> </span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><i>process</i></span><span style="font-variant-ligatures: no-common-ligatures;"> "SystemUIServer" <b>to</b> <b>tell</b> (</span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><i>menu bar item</i></span><span style="font-variant-ligatures: no-common-ligatures;"> 1 <b>of</b> </span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><i>menu bar</i></span><span style="font-variant-ligatures: no-common-ligatures;"> 1 <b>whose</b> </span><span style="color: #812fdc; font-variant-ligatures: no-common-ligatures;">description</span><span style="font-variant-ligatures: no-common-ligatures;"> <b>is</b> "bluetooth") <b>to</b> {</span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><b>click</b></span><span style="font-variant-ligatures: no-common-ligatures;">, </span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><b>click</b></span><span style="font-variant-ligatures: no-common-ligatures;"> (</span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><i>menu item</i></span><span style="font-variant-ligatures: no-common-ligatures;"> 2 <b>of</b> </span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><i>menu</i></span><span style="font-variant-ligatures: no-common-ligatures;"> 1)}</span></div>
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 41.6px; min-height: 15px; text-indent: -41.6px;">
<span style="font-variant-ligatures: no-common-ligatures;"></span><br /></div>
<br />
<div style="font-family: Verdana; font-size: 12px; line-height: normal; margin-left: 41.6px; text-indent: -41.6px;">
<span style="font-variant-ligatures: no-common-ligatures;"><b>tell</b> </span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><i>application</i></span><span style="font-variant-ligatures: no-common-ligatures;"> "System Events" <b>to</b> <b>tell</b> </span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><i>process</i></span><span style="font-variant-ligatures: no-common-ligatures;"> "SystemUIServer" <b>to</b> <b>tell</b> (</span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><i>menu bar item</i></span><span style="font-variant-ligatures: no-common-ligatures;"> 1 <b>of</b> </span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><i>menu bar</i></span><span style="font-variant-ligatures: no-common-ligatures;"> 1 <b>whose</b> </span><span style="color: #812fdc; font-variant-ligatures: no-common-ligatures;">description</span><span style="font-variant-ligatures: no-common-ligatures;"> <b>starts with</b> "Wi-Fi") <b>to</b> {</span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><b>click</b></span><span style="font-variant-ligatures: no-common-ligatures;">, </span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><b>click</b></span><span style="font-variant-ligatures: no-common-ligatures;"> (</span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><i>menu item</i></span><span style="font-variant-ligatures: no-common-ligatures;"> 2 <b>of</b> </span><span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><i>menu</i></span><span style="font-variant-ligatures: no-common-ligatures;"> 1)}</span></div>
<br />
To learn the correct description terms open Accessibility Inspector and choose point to inspect (crosshair), then select the menubar item that should match the description. The description is the label name in Basic section. Be aware that the label may change depending on the state of the menubar item (e.g. Wifi changes the trailing string after "Wi-Fi" depending on the connection status, whereas "bluetooth" does not)<br />
<br />
<div style="line-height: normal; margin-left: 41.6px; text-indent: -41.6px;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHCNvL1S6zxu2ibjEQxpxpHoFZMBPJAL-G4Oc_DpzrCheCy0ACDCJV8glw_PJ9Qg6o6d6NEcW-O-6fFxslQx-kcZ5kYmfyNmwgv53i6GQMHJY_-Z-SOSKPnSlf35L0D47fWmjxy4eOotQ/s1600/Accessibility_Inspector_grab.png" imageanchor="1"><img border="0" height="621" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHCNvL1S6zxu2ibjEQxpxpHoFZMBPJAL-G4Oc_DpzrCheCy0ACDCJV8glw_PJ9Qg6o6d6NEcW-O-6fFxslQx-kcZ5kYmfyNmwgv53i6GQMHJY_-Z-SOSKPnSlf35L0D47fWmjxy4eOotQ/s640/Accessibility_Inspector_grab.png" width="640" /></a></div>
Anonymoushttp://www.blogger.com/profile/02122110458441117948noreply@blogger.com0tag:blogger.com,1999:blog-4179458787533239815.post-45005965407157768742015-08-10T11:16:00.000+02:002015-10-21T17:26:53.329+02:00[Updated] Fix for slow shutdown when using Synology CloudStation client on OSX<b><br /></b>
<b>UPDATE: As of version 3.2-3487 of the CloudStation app the slow shutdown times have been fixed (at least on OSX 10.11 El Capitan). Note that the older versions still had problems on OSX 10.11 El Capitan, and only the listed version seems to fix this on my 2013 13" Retina MBP.</b><br />
<br />
I've noticed that my mac is experiencing slow shutdown times (~30-50 sec slower than usual) when the Synology CloudStation client/app is running. This has been seen on version: 3.2-3482 and one version earlier.<br />
<br />
Doing some diagnostics I noticed that the process "cloud-eventd" was not terminated even when the CloudStation client/app was told to terminate. This process would then make the system wait for a graceful termination before continuing the shutdown (or reboot) process. And this is what caused the delay of ~30-50 sec.<br />
<br />
I've been in contact with support twice, but so far no fix has been published and I've instead created an AppleScript that is able to detect if both the client/app and the offending process is running and then terminate both.<br />
<br />
Upon completion it will then give the possibility of shutting down, restarting or nothing.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIpcrF1_h7Bc_mDHIEI_rGGEENRoh3pZW-3lZhSoX-jZAVXYPM9zJpmtcruef7ZYAkwVvpsbiZM2wfS3qWORXQAVwVikCVPiHRjoKnyTdxRLU6JFiv_32Vq7M19_TCdFMtrC-MkydSWY0/s1600/Screen+Shot+2015-08-10+at+11.10.32.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="160" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIpcrF1_h7Bc_mDHIEI_rGGEENRoh3pZW-3lZhSoX-jZAVXYPM9zJpmtcruef7ZYAkwVvpsbiZM2wfS3qWORXQAVwVikCVPiHRjoKnyTdxRLU6JFiv_32Vq7M19_TCdFMtrC-MkydSWY0/s320/Screen+Shot+2015-08-10+at+11.10.32.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
Here's a screenshot showing the dialog.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The script is pasted below and I would recommend that the script is exported as an application so you can easily call it from e.g. Spotlight. (I named mine powerOff.app)</div>
<div class="separator" style="clear: both; text-align: left;">
<b><i>NOTE: The script needs admin rights to kill the "cloud-eventd" as it is owned by root. As a result there will be a request for an admin password if the process is to be terminated.</i></b></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div style="font-family: Verdana; font-size: 12px; margin-left: 41.6px; text-indent: -41.6px;">
<b>set</b> <span style="color: #4f8f00; font-variant-ligatures: no-common-ligatures;">no_action</span> <b>to</b> "- No action performed"</div>
<div style="color: #4f8f00; font-family: Verdana; font-size: 12px; margin-left: 41.6px; text-indent: -41.6px;">
<span style="color: black; font-variant-ligatures: no-common-ligatures;"><b>set</b> </span>answer<span style="color: black; font-variant-ligatures: no-common-ligatures;"> <b>to</b> </span>no_action</div>
<div style="font-family: Verdana; font-size: 12px; margin-left: 41.6px; min-height: 15px; text-indent: -41.6px;">
<br /></div>
<div style="font-family: Verdana; font-size: 12px; margin-left: 41.6px; text-indent: -41.6px;">
<b>set</b> <span style="color: #4f8f00; font-variant-ligatures: no-common-ligatures;">app_name</span> <b>to</b> "CloudStation"</div>
<div style="font-family: Verdana; font-size: 12px; margin-left: 41.6px; text-indent: -41.6px;">
<b>if</b> <span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><i>application</i></span> <span style="color: #4f8f00; font-variant-ligatures: no-common-ligatures;">app_name</span> <b>is</b> <span style="color: #812fdc; font-variant-ligatures: no-common-ligatures;">running</span> <b>then</b></div>
<div style="color: #0433ff; font-family: Verdana; font-size: 12px; margin-left: 78.5px; text-indent: -78.6px;">
<span style="color: black; font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>tell</b> </span><i>application</i><span style="color: black; font-variant-ligatures: no-common-ligatures;"> </span><span style="color: #4f8f00; font-variant-ligatures: no-common-ligatures;">app_name</span><span style="color: black; font-variant-ligatures: no-common-ligatures;"> <b>to</b> </span><b>quit</b></div>
<div style="font-family: Verdana; font-size: 12px; margin-left: 78.5px; text-indent: -78.6px;">
<span class="Apple-tab-span" style="white-space: pre;"> </span><b>set</b> <span style="color: #4f8f00; font-variant-ligatures: no-common-ligatures;">answer</span> <b>to</b> "- Application " & <span style="color: #4f8f00; font-variant-ligatures: no-common-ligatures;">app_name</span> & " terminated"</div>
<div style="color: #0433ff; font-family: Verdana; font-size: 12px; margin-left: 78.5px; text-indent: -78.6px;">
<span style="color: black; font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><b>delay</b><span style="color: black; font-variant-ligatures: no-common-ligatures;"> 2</span></div>
<div style="font-family: Verdana; font-size: 12px; margin-left: 41.6px; text-indent: -41.6px;">
<b>end</b> <b>if</b></div>
<div style="font-family: Verdana; font-size: 12px; margin-left: 41.6px; min-height: 15px; text-indent: -41.6px;">
<br /></div>
<div style="font-family: Verdana; font-size: 12px; margin-left: 41.6px; text-indent: -41.6px;">
<b>set</b> <span style="color: #4f8f00; font-variant-ligatures: no-common-ligatures;">proc_name</span> <b>to</b> "cloud-eventd"</div>
<div style="font-family: Verdana; font-size: 12px; margin-left: 41.6px; text-indent: -41.6px;">
<b>set</b> <span style="color: #4f8f00; font-variant-ligatures: no-common-ligatures;">the_pid</span> <b>to</b> (<span style="color: #012fbe; font-variant-ligatures: no-common-ligatures;"><b>do shell script</b></span> "ps ax | grep " & (<span style="color: #812fdc; font-variant-ligatures: no-common-ligatures;">quoted form</span> <b>of</b> <span style="color: #4f8f00; font-variant-ligatures: no-common-ligatures;">proc_name</span>) & " | grep -v grep | awk '{print $1}'")</div>
<div style="font-family: Verdana; font-size: 12px; margin-left: 41.6px; text-indent: -41.6px;">
<b>if</b> <span style="color: #4f8f00; font-variant-ligatures: no-common-ligatures;">the_pid</span> <b>is</b> <b>not</b> "" <b>then</b></div>
<div style="color: #012fbe; font-family: Verdana; font-size: 12px; margin-left: 78.5px; text-indent: -78.6px;">
<span style="color: black; font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><b>do shell script</b><span style="color: black; font-variant-ligatures: no-common-ligatures;"> ("kill -9 " & </span><span style="color: #4f8f00; font-variant-ligatures: no-common-ligatures;">the_pid</span><span style="color: black; font-variant-ligatures: no-common-ligatures;">) <b>with</b> </span>administrator privileges</div>
<div style="color: #4f8f00; font-family: Verdana; font-size: 12px; margin-left: 78.5px; text-indent: -78.6px;">
<span style="color: black; font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>if</b> </span>answer<span style="color: black; font-variant-ligatures: no-common-ligatures;"> <b>is</b> </span>no_action<span style="color: black; font-variant-ligatures: no-common-ligatures;"> <b>then</b></span></div>
<div style="font-family: Verdana; font-size: 12px; margin-left: 117.8px; text-indent: -117.8px;">
<span class="Apple-tab-span" style="white-space: pre;"> </span><b>set</b> <span style="color: #4f8f00; font-variant-ligatures: no-common-ligatures;">answer</span> <b>to</b> "- Process " & <span style="color: #4f8f00; font-variant-ligatures: no-common-ligatures;">proc_name</span> & " terminated"</div>
<div style="font-family: Verdana; font-size: 12px; margin-left: 78.5px; text-indent: -78.6px;">
<span class="Apple-tab-span" style="white-space: pre;"> </span><b>else</b></div>
<div style="font-family: Verdana; font-size: 12px; margin-left: 117.8px; text-indent: -117.8px;">
<span class="Apple-tab-span" style="white-space: pre;"> </span><b>set</b> <span style="color: #4f8f00; font-variant-ligatures: no-common-ligatures;">answer</span> <b>to</b> <span style="color: #4f8f00; font-variant-ligatures: no-common-ligatures;">answer</span> & "</div>
<div style="font-family: Verdana; font-size: 12px; margin-left: 39.2px; text-indent: -39.3px;">
" & "- Process " & <span style="color: #4f8f00; font-variant-ligatures: no-common-ligatures;">proc_name</span> & " terminated"</div>
<div style="font-family: Verdana; font-size: 12px; margin-left: 78.5px; text-indent: -78.6px;">
<span class="Apple-tab-span" style="white-space: pre;"> </span><b>end</b> <b>if</b></div>
<div style="font-family: Verdana; font-size: 12px; margin-left: 41.6px; text-indent: -41.6px;">
<b>end</b> <b>if</b></div>
<div style="font-family: Verdana; font-size: 12px; margin-left: 41.6px; min-height: 15px; text-indent: -41.6px;">
<br /></div>
<div style="font-family: Verdana; font-size: 12px; margin-left: 41.6px; text-indent: -41.6px;">
<b>set</b> <span style="color: #4f8f00; font-variant-ligatures: no-common-ligatures;">reaction</span> <b>to</b> <b>the</b> <span style="color: #5730be; font-variant-ligatures: no-common-ligatures;">button returned</span> <b>of</b> (<span style="color: #012fbe; font-variant-ligatures: no-common-ligatures;"><b>display dialog</b></span> "CloudStation killer:</div>
<div style="font-family: Verdana; font-size: 12px; margin-left: 41.6px; text-indent: -41.6px;">
" & <span style="color: #4f8f00; font-variant-ligatures: no-common-ligatures;">answer</span> <span style="color: #012fbe; font-variant-ligatures: no-common-ligatures;">buttons</span> {"Shutdown", "Reboot", "Dismiss"} <span style="color: #012fbe; font-variant-ligatures: no-common-ligatures;">default button</span> 3)</div>
<div style="font-family: Verdana; font-size: 12px; margin-left: 41.6px; min-height: 15px; text-indent: -41.6px;">
<br /></div>
<div style="font-family: Verdana; font-size: 12px; margin-left: 41.6px; text-indent: -41.6px;">
<b>if</b> <span style="color: #4f8f00; font-variant-ligatures: no-common-ligatures;">reaction</span> <b>is</b> "Shutdown" <b>then</b></div>
<div style="color: #0433ff; font-family: Verdana; font-size: 12px; margin-left: 78.5px; text-indent: -78.6px;">
<span style="color: black; font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>tell</b> </span><i>application</i><span style="color: black; font-variant-ligatures: no-common-ligatures;"> "Finder" <b>to</b> </span><b>shut down</b></div>
<div style="font-family: Verdana; font-size: 12px; margin-left: 41.6px; text-indent: -41.6px;">
<b>else</b> <b>if</b> <span style="color: #4f8f00; font-variant-ligatures: no-common-ligatures;">reaction</span> <b>is</b> "Reboot" <b>then</b></div>
<div style="font-family: Verdana; font-size: 12px; margin-left: 78.5px; text-indent: -78.6px;">
<span class="Apple-tab-span" style="white-space: pre;"> </span><b>tell</b> <span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><i>application</i></span> "Finder" <b>to</b> <span style="color: #0433ff; font-variant-ligatures: no-common-ligatures;"><b>restart</b></span></div>
<div class="separator" style="clear: both;">
</div>
<div style="font-family: Verdana; font-size: 12px; margin-left: 41.6px; text-indent: -41.6px;">
<b>end</b> <b>if</b></div>
Anonymoushttp://www.blogger.com/profile/02122110458441117948noreply@blogger.com1tag:blogger.com,1999:blog-4179458787533239815.post-49470492966238272602015-07-31T13:36:00.000+02:002015-07-31T13:50:12.654+02:00Removing OneDrive shorcut in File Explorer (Windows 10)So I just installed Windows 10 and was instantly annoyed by the OneDrive integration. After disabling auto-start and closing the program I noticed that there is a fixed shortcut in File Explorer.<BR>
<BR>
On youtube I found a video that explained to enter Registry Editor and remove these two keys:<BR>
- HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}<BR>
- HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}<BR>
<b>NOTE: YOU MAY WANT TO EXPORT THE KEYS BEFORE DELETING THEM, IN CASE YOU WOULD LIKE TO USE ONEDRIVE IN THE FUTURE.</b><BR>
<BR>
The fix is instant, but you must close all File Explorer windows before the changes take effect.Anonymoushttp://www.blogger.com/profile/02122110458441117948noreply@blogger.com1tag:blogger.com,1999:blog-4179458787533239815.post-12323387800865069112014-02-07T16:20:00.000+01:002014-02-07T16:20:37.105+01:00xbox one power supply pinoutSo I brought a new xbox one back from US to Denmark and realized (the hard way, aka smokey) that it is not usable on the 230V outputs.<br />
<br />
xbox support has been helpful and I can buy a new 230V through them for 32.9 EUR plus 5.0 EUR shipping.<br />
<br />
While I wait for that one I'm looking at how to power the xbox one using a PC (ATX) power supply. A lot of guides exists for the xbox 360 online, but I wasn't able to find the pinout of the xbox one power supply. So I simply took the damaged power supply apart and mapped out the pins:<br />
<br />
Type Color Rating Note<br />
GND Black/Grey - GND_5V is grey, but internally connected to GND.<br />
12V Yellow 17.9 A<br />
5V Red 1.0 A<br />
PWRON Blue - Must be used for communication between xbox and PSU.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAgUx3MDfrEbODil4nOT387QAXUA8lB2c23Hcszr2pv9-eVU4ai-1SPuH487R-VRXhgiBKn5ujr9symvl-74M2SlmNfoATflpBhSc3pi0p4GvijubVyC_XN9UK47rfVow4xZafBNuBeWc/s1600/Screen+Shot+2014-02-03+at+1.28.52+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="image_missing-xbox-one-power-supply-pinout" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAgUx3MDfrEbODil4nOT387QAXUA8lB2c23Hcszr2pv9-eVU4ai-1SPuH487R-VRXhgiBKn5ujr9symvl-74M2SlmNfoATflpBhSc3pi0p4GvijubVyC_XN9UK47rfVow4xZafBNuBeWc/s1600/Screen+Shot+2014-02-03+at+1.28.52+PM.png" height="640" title="xbox one power supply pinout" width="560" /></a></div>
The upper left insert in the image above shows how the colored wires are arranged in the plug from the power supply: GND (black & grey) is on both outer walls of the two cylinders and 12V are on both inside walls. Looking into the plug (not into the xbox one!) the pin inside the LEFT cylinder is PWRON and the PIN inside the right cylinder is 5V (when the plastic "bridge" between the cylinders is flat on top and curved curved underneath).<br />
<br />
Follow any xbox 360 ATX power supply guide (like this: <a href="http://www.xpgamesaves.com/topic/21589-tutorial-xbox360-power-supply-mod-pc-psu/">http://www.xpgamesaves.com/topic/21589-tutorial-xbox360-power-supply-mod-pc-psu/</a>) but remember to use the PWRON pin to enable communication between the xbox one and the power supply.<br />
<br />
Also note that the power supply in use must be able to deliver 17.9A at 12V (yellow wires) and 1A at 5V (red wire).<br />
<br />
Happy modding!Anonymoushttp://www.blogger.com/profile/02122110458441117948noreply@blogger.com11tag:blogger.com,1999:blog-4179458787533239815.post-30079656730727808992013-10-28T14:52:00.002+01:002013-10-28T14:52:17.681+01:00Disabling auto- emoticons/emoji/smiley in OSX 10.9 Mavericks for Messages appHere's a thing that bugged my since upgrading to OSX 10.9 Mavericks: The messages app kept changing regular ascii-emoticons such as ":)" to the build-in icon type emoticons known from iOS...<br />
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Since searching the web didn't produce results from OSX 10.9 Mavericks I had to figure it out myself. There is no way to change this in settings, and the way it was done in OSX 10.8 Mountain Lion (right click the conversation area and choose "Show Smileys)" was not available.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The simple way to disable the auto-emoticons is to <b>right click in the text input area</b>, select <b>Substitutions</b> and click on "<b>Emoji</b>" (or "Text Replacement" in general if you do not like that).</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The screenshot shows where to locate the option.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbOeYsxlLZbBy7CjaLr1rbMxKHIropsUzIjo3cp-bSFxNZVLrYlOIOJ5yLdhyphenhyphenCwOXkACde9aOPFMGSabZbut-Nu4J7Ur68jP-E4DhXXS8PWHsaPev0y_oeLCqNrIlcG5LsiN0K7RSkdYo/s1600/OSX_10_9_Messages_disable_emoji.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="561" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbOeYsxlLZbBy7CjaLr1rbMxKHIropsUzIjo3cp-bSFxNZVLrYlOIOJ5yLdhyphenhyphenCwOXkACde9aOPFMGSabZbut-Nu4J7Ur68jP-E4DhXXS8PWHsaPev0y_oeLCqNrIlcG5LsiN0K7RSkdYo/s640/OSX_10_9_Messages_disable_emoji.png" width="640" /></a></div>
Anonymoushttp://www.blogger.com/profile/02122110458441117948noreply@blogger.com0