Applescript - ignore modifier keys I have an applescript that needs to be called by an external program with command-shift-click.  However, the applescript then performs keystrokes with command & shift held down.  How do I get around this?

I tried:

keystroke "blah" using command up

but get this syntax error:
Expected end of line, etc. but found application constant or consideration.

I've similarly tried

key up shift
key up command
keystroke "blah"

and this simply doesn't work - the command/shift keys are still held.

Is using documented anywhere that might help me resolve this?  Otherwise, how do you make the applescript ignore user-held modifier keys?

EDIT: A workaround (but not a solution): https://stackoverflow.com/questions/6584357/why-applescript-always-send-keystrokes-with-command-down  add delay 0.2 before the script

The most robust solution is to make a system call that checks which modifier keys are currently pressed.  The following solution uses small external executable written in C that you can compile yourself from the command line (provided you have Xcode installed).

If you don't know C, don't worry!  You'll only need to copy and paste the C code.  It's called using a simple AppleScript handler.

Technical Note: The following code is based on macOS's Carbon framework.  It should also be possible to create a Cocoa solution that would allow everything to be called directly from AppleScript using AppleScript-Objective-C.

Create the Compiled Executable

Follow these instructions to create a command-line program that prints the current modifier keys. You must have the Xcode Command Line Tools (or the full Xcode) installed in order to compile the code.

Save the following code as getModifierKeys.c in the Desktop folder:

#include <Carbon/Carbon.h>

// Define the key code for the fn Key.
const unsigned int fnKey = 131072;

// Define the accepted labels for the modifier keys. The first label is used by the program for output.
const char *cmdLabels[] = {"command", "cmd", "@", "⌘"};
const char *controlLabels[] = {"control", "ctrl", "ctl", "^", "⌃"};
const char *optionLabels[] = {"option", "opt", "alt", "~", "⌥"};
const char *shiftLabels[] = {"shift", "$", "⇧"};
const char *fnLabels[] = {"fn", "function", "func"};
const char *alphaLabels[] = {"caps", "caps lock", "caps_lock", "caps-lock", "capslock", "alpha", "⇪"};

// Define the order to use when returning the modifier keys.
const unsigned int modifierKeyValues[] = {cmdKey, controlKey, optionKey, shiftKey, fnKey, alphaLock};
const char **modifierKeyLabels[] = {cmdLabels, controlLabels, optionLabels, shiftLabels, fnLabels, alphaLabels};
const unsigned int modifierKeyLabelsCount[] = {(sizeof cmdLabels / sizeof *cmdLabels), (sizeof controlLabels / sizeof *controlLabels), (sizeof optionLabels / sizeof *optionLabels), (sizeof shiftLabels / sizeof *shiftLabels), (sizeof fnLabels / sizeof *fnLabels), (sizeof alphaLabels / sizeof *alphaLabels)};

// Get the length of the above arrays.
const unsigned int modifierKeyCount = (sizeof modifierKeyValues / sizeof *modifierKeyValues);

// Define the label to use for no modifier keys.
const char *noneLabel = "none";

// Declare the helper function to determine matches to the labels.
int arg_match(const char *, const char *[], int);

// Main function.
int main (int argc, const char *argv[]) {
    // Get the current modifier key codes.
    unsigned int current_modifier_keys = GetCurrentKeyModifiers();
    unsigned int i;
    unsigned int modifiers_count = 0;

    for (i = 0; i < modifierKeyCount; i++) { // Loop through all possible modifier keys again, and print the label.
        if (current_modifier_keys & modifierKeyValues[i]) {
            if (modifiers_count) { printf(" "); }
            modifiers_count++;
            printf("%s", modifierKeyLabels[i][0]);
        }
    }

    if (modifiers_count) {
        printf("\n");
    } else {
        printf("%s\n", noneLabel);
    }

    return 0;
}

// Helper function to determine matches to the labels.
int arg_match(const char *arg_string, const char *key_labels[], int key_labels_length) {
    for (int i = 0; i < key_labels_length; i++) {
        if (0 == strcasecmp(arg_string, key_labels[i])) {
            return 1;
        }
    }
    return 0;
}

Compile the program by running the following commands from Terminal:

cd ~/Desktop
gcc -framework Carbon getModifierKeys.c -o getModifierKeys

You will now have an executable file named getModifierKeys on your Desktop. Move this to wherever you want to store it.

Call the Executable from AppleScript

The following handler is used to call the executable for AppleScript. The handler will block until the specified modifier keys are no longer pressed.

Copy the following handler into your AppleScript, and replace /PATH/TO/EXECUTABLE with the absolute path to the executable you created in the previous step (if you didn't move it, it will be located at /Users/USERNAME/Desktop/getModifierKeys).

to waitForModifierKeyRelease(modifier_keys)
    (*    (string OR list of strings) → nothing

    Block execution until all of the keys specified in modifier_keys are released.
    Modifier keys are specified by their name; multiple keys may be specified in a space-delimited string or in a list.
    The possible modifier keys are "command", "control", "option", "shift", "fn", and "caps".

    Parameters:
    modifier_keys [string OR list of strings] : The modifier keys to await release.

    Result:
    [nothing] : No return value.    *)

    set should_wait to true
    repeat while should_wait
        set current_modifier_keys to do shell script quoted form of "/PATH/TO/EXECUTABLE"

        set should_wait to false
        set should_wait to should_wait or (current_modifier_keys contains "command" and modifier_keys contains "command")
        set should_wait to should_wait or (current_modifier_keys contains "control" and modifier_keys contains "control")
        set should_wait to should_wait or (current_modifier_keys contains "option" and modifier_keys contains "option")
        set should_wait to should_wait or (current_modifier_keys contains "shift" and modifier_keys contains "shift")
        set should_wait to should_wait or (current_modifier_keys contains "fn" and modifier_keys contains "fn")
        set should_wait to should_wait or (current_modifier_keys contains "caps" and modifier_keys contains "caps")
    end repeat

    return

end waitForModifierKeyRelease

Call the handler before the keystroke command (or any other commands that behave unpredictably when modifier keys are pressed), specifying the keys that you don't want to be pressed.

my waitForModifierKeyRelease({"command", "control", "option", "shift"})

The "fn" and "caps" modifiers are not used in this example; note also that the "caps" modifier indicates whether caps lock is active, not whether the key is physically pressed.


Using the home (house) button in Logitech K400 keyboard I've just bought the Logitech K400 keyboard/trackpad combo. The volume buttons above the keyboard works just fine. But the home button (that has a small "house" icon) doesn't do anything on OS X Lion.

Is there a way I can use it to display Launchpad? I've tried using System Preferences to use it as a "hot key" but it didn't register any key press there.

With my S530 I had to install the Logitech Control Center for OS X in order to configure the custom keys. Once you install that, you'll see a control center entry in your System Preferences panel:

Before you can assign a shortcut to the Home key on the keyboard, you need to make a keyboard shortcut for Launchpad as there is none by default. Open System Preferences and go to Keyboard settings. Click the Keyboard Shortcuts tab and select Launchpad & Dock. Make sure 'Show Launchpad' is checked and then double click over the area that shows the shortcut to assign a new shortcut (I used Alt-Cmd-L in the screen shot). If you can't assign a shortcut try unchecking and re-checking the Show Launchpad setting:

Now enter the Logitech Control Center, select your device and click the Configure button:

Click the Keys icon at the top to configure custom keys on the keyboard. Find the Home key in the list. Set the 'Assigned action' for the Home key to 'Keystroke. And configure the keystroke issued to be the one you assigned to Launchpad above. In my case it would be Alt-Cmd-L.


How to run script on startup and shutdown OS X El Capitan Actually I want to make a RAM drive related to this script on my Mac.

Here is what I did:

Disabled SIP in recovery mode using command "csrutil"
Created a plist file in /Library/LaunchDaemons/
and entered launchctl -w /Library/LaunchDaemons/vn.magik.ramdisk.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>Label</key>
            <string>vn.magik.ramdisk</string>
        <key>ProgramArguments</key>
            <array>
              <string>/Users/khacpm/ramdisk.sh</string>
            </array>
        <key>RunAtLoad</key>
            <true/>
        <key>StandardOutPath</key>
            <string>/Users/khacpm/ramdisk.log</string>
        <key>StandardErrorPath</key>
            <string>/Users/khacpm/ramdisk.err</string>
    </dict>
</plist>

Created .sh file and put it in ~/ramdisk.sh

code:

function fstartup()
{
    //put folder into ramdisk
}
function fshutdown()
{
    //detach ramdisk
}

function framdisk()
{
    //do something
}
trap fshutdown SIGTERM
trap fshutdown SIGKILL
fstartup;

The problem is, the function fstartup runs well but it seems like function fshutdown isn't called by the system.

I believe the correction to the shell script should be:

function fstartup()
{
    //put folder into ramdisk
     tail -f /dev/null &
     wait $!
}
function fshutdown()
{
    //detach ramdisk

}

function framdisk()
{
    //do something
}
trap fshutdown SIGTERM
trap fshutdown SIGKILL
fstartup;

So that it will wait during the startup, not the shutdown.

I'm currently running my version and it appears to work fine, it correctly runs the shutdown function when the computer is shutting down.


What are launchd's LaunchAgents directories for? I created some job plist files and put them in ~/Library/LaunchAgents. Now I don't see the point of this special directory (see launchd manpage). When I want to load a job, I have to specify a whole path to a plist file. Or can I somehow restart launchd so that it reads those files again?

Depending on the key Disabled the job definitions in ~/Library/LaunchAgents will be loaded automatically by launchd whenever the user logs in.


Boot 2010 iMac from 2007 MacBook Pro's drive? I am considering purchasing a 2010 27" iMac to replace my 2007 MacBook Pro as my everyday development machine.  Ideally, I would like to work on the iMac when I am in my home office and work on the MacBook Pro when I am out at a clients office, coffeeshop, etc.  I would like both machines to be in sync so I don't have to worry about not having an application installed, missing project files, etc.

Is it possible to use the internal drive on the MacBook Pro as the boot drive of the iMac?  This would enable me to simply shut the machines down, disconnect my MacBook Pro and have a less powerful but functionally equivalent machine to go.  If it is possible what are the drawbacks?  Are things like system updates machine specific which would prevent me from updating the OS using the iMac and then trying to boot into the MacBook?

I am not interested in using an external drive to boot the MacBook as it would be too cumbersome, nor am I interested in using the iMac as merely a display for the MacBook since the iMac will be significantly faster.

If using the laptop as a boot drive is not feasible are their other options I should consider?

It may be possible, but not recommended. While you don't really have to worry about drivers so much - there may be minor incompatibilities. That is if you get it to boot - especially if the MacBook Pro isn't running the latest version of the OS thats after whatever originally came on the iMac.

System updates can be used across machines, but when the install is being done it does check the hardware. You may end up installing iMac specific things on your MacBook Pro, which may cause issues.

You really have two routes:

Buy a new MacBook Pro instead, and an external monitor. Therefore you have the same machine, and can go wherever.
Sync the two machines using items like Dropbox, etc. I understand maybe application differences, but thats a very small issue (almost a non issue). Keep most of your files on dropbox, and everythings always in sync.

I would go (and do use) the second solution. My primary machine is a 27" iMac, but I constantly use my wifes 13" MacBook Pro when going out or not at my desk. I then keep most all active documents in Dropbox and sync between. Both are outfitted with the software I need (in my case, Aperture, TextWrangler, Xcode, etc).


How do I search quickly in iTerm 2? When searching in iTerm2, some kind of of fancy live highlighting thing seems to kick in even before you hit enter. When the scrollback buffer has more than a few thousand lines in it, this search mode seems to become unusably slow. It maxes out a CPU at 100% and doesn't actually find anything while it's "thinking", making it impossible to search long scroll buffers. And it never finishes thinking (at least not quickly enough for me to have seen it ever finish).

Even just typing the characters into the search box becomes slow, one character appearing per second.

Is it possible to disable the highlighting (to only highlight the current result) or otherwise speed up search? I'm trying to switch from Terminal.app to iTerm but, as I have discovered, I search a lot.

I haven't encountered this particular problem, but I also don't use the built in searching feature very much.

Because of how this is programmed, it does duplicate work. Say you want to search for "set background mode"; as you are typing it searches for "s", then "se", then "set", etc. Using copy and paste for your search term may help a little bit but probably not noticeably.

Alternative 1: Play with iTerm settings

You can find the iTerm 2 scrollback settings in Preferences > Profiles > Terminal > Scrollback Buffer

Mine are set to:

[x] Unlimited scrollback
[ ] Save lines to scrollback when an app status bar is present
[x] Save lines to scrollback in alternate screen mode

Alternative 2: Reduce the size of your scrollback buffer

If you untick "Unlimited scrollback", you can then set a small value for Scrollback Lines. This will reduce the amount to text that have to be searched. It could make your searching more tolerable at the expense of a smaller scrollback.

Alternative 3: Upgrade to the latest version

I'm using iTerm2 Build 2.9.20151111, which is a Beta for 3.0. It operates very well and has additional features over the stable 2.x version.

Alternative 4: Take this question to the developers

This should really be Alternative 1. Truthfully, this question is probably best addressed to the developers of iTerm 2. Don't worry, they don't bite.

The main page is here. You can post questions on their forum or report this on their bug tracker.


When using CMD-Tab, how to re-open the app's main window? I hit this problem often when interacting with some Apple applications, mainly Messages and iTunes.

After starting a song with iTunes, to clear my screen and get back to work I close the iTunes window with CMD-W. The iTunes application is still running in my Dock and playing music.

After some time, I want to switch to a different album. I CMD-Tab to select the iTunes application. iTunes is focused in the menu bar. But no window is shown, because I previously closed the window.

This workflow occurs for all apps, and is not usually a problem. If I switch to Safari and no window is open, I simply press CMD-T or CMD-N to open a new tab or new window.

With iTunes, I press CMD-N and nothing happens. No iTunes window is created or shown. The Application is focused, but the main window is not re-opened if it is currently closed.

I end up clicking on the Dock, which (in addition to focusing the application) opens a new iTunes window if that window was previously closed.

This breaks my (usually more efficient) CMD-Tab workflow. If I'm forced to click the iTunes dock icon, I may as well just click the dock icon from the start and forgo the keyboard shortcut.

Messages has a similar problem. If I receive a desktop notification and use CMD-Tab to open Messages to respond, the application will be focused but no window will be opened. I can press CMD-N, which in Message's case does open a new window, but the "new message" cell will be opened rather than the existing conversation I had open and now want to respond to.

When clicking the Dock icon or opening the app via a Spotlight Search, if the main window is not open then it will be re-opened. Is there a way to force this behavior for CMD-Tab app selection?

How do I show the main window when the Application is focused via CMD-Tab?

There exists a shortcut for that, though it requires certain dexterity:

Command-Tab to the app, but then, before releasing Command, hold Option.

If you then release Command while still holding Option, the window should pop open.

It's just like clicking in the app icon in the Dock (if there are no windows open, one opens; if there is a minimized window, it appears again).


Which one is being used when I have two internet connections? My macbook always connects to wireless when I'm at work. I usually connect Lan to usb adapter to my macbook as well.

In this case, I end up having two connections -- Lan to USB and Wireless.

Am I using wireless or lan to usb connection?

If you go to 'System Preferences -> Network' the order in which the connections appear in the sidebar is the order in which they will be used.

You can use the settings button at the bottom of the panel to re-order the connections to your preference.


Latency spikes on wifi - power saving measure? I'm seeing intermittent latency spikes when on wifi, but only when pinging my MBP from another machine and not when pinging from the MBP to another machine. It seems to be causing stuttering with Steam In-Home Streaming. Any suggestions are greatly appreciated!

I feel strongly that this is the Mac and not the networking hardware. I've seen it on multiple access points across different vendors and channels. 2.4G and 5G are both affected.

With wifi logging enabled, nothing is logged in /var/log/wifi.log during the ping test. Location services are disabled, and I'm not clicking on the wifi icon during the test. I have tried resetting the SMC.

Update: Shown below is the minimal example. I have run this test many times and for long durations. I have been constantly ingesting ping data into InfluxDB using Telegraf. Here is the last 7 days, where the orange is my MacBook. There are a couple other anomalies present, but it's clear the high latency has been occurring for a while.

Update 2: Wireshark on the MBP shows ICMP "Response Time" as consistently < 0.1ms during the test. I believe it's looking at the time between when it sees the request come in from the reply go out.

Here's the test. 192.168.1.242 is my MBP. After quitting (nearly) every application:

craig@pluto ~> ping 192.168.1.242 -i 2
...
22 packets transmitted, 22 received, 0% packet loss, time 78ms
rtt min/avg/max/mdev = 1.037/*22.550*/*89.237*/28.546 ms

But outgoing pings are fine:

craig@Craigs-MBP ~> ping 192.168.1.3 -i 2
...
266 packets transmitted, 266 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.909/1.526/8.716/0.686 ms

Now here's something curious. If I rapidly send pings out, the inbound variance disappears!

craig@Craigs-MBP ~> ping 192.168.1.3 -i 0.2
...
417 packets transmitted, 417 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.984/1.469/3.799/0.290 ms

(while the above is running)

craig@pluto ~> ping 192.168.1.242 -i 2
...
38 packets transmitted, 38 received, 0% packet loss, time 147ms
rtt min/avg/max/mdev = 1.001/*1.664*/3.758/0.767 ms

Given this, my best guess is there is some kind of power saving mechanism turning off the radio.

craig@Craigs-MBP ~> pmset -g
System-wide power settings:
Currently in use:
 standbydelaylow      10800
 standby              1
 womp                 0
 halfdim              1
 hibernatefile        /var/vm/sleepimage
 powernap             1
 gpuswitch            2
 networkoversleep     0
 disksleep            10
 standbydelayhigh     86400
 sleep                0
 autopoweroffdelay    28800
 hibernatemode        3
 autopoweroff         1
 ttyskeepawake        1
 displaysleep         10
 highstandbythreshold 50
 acwake               0
 lidwake              1

Update 3: Here are two simultaneous packet captures with the "same" ICMP packet highlighted. The left was captured using tcpdump on the Ubiquiti UniFi access point that my MBP is connected to, and the right was captured on the MBP. You can see the sequence number is the same. But the calculated response time from the access point's point-of-view is relatively high at 71 ms, while the MBP saw < 1 ms between the request and the response.

Yes, there is indeed such a power saving measure implemented on the Mac. This is common across WiFi chipsets on all platforms and operating systems, and is actually part of the WiFi standard itself.

The PSM (power saving mode) of the WiFi chipset takes many forms. This you're probably experiencing is known as the "connected-idle" mode. In this mode it introduces a small latency of less than 100 ms (typically 50-100 ms) for the first packet received after the module was put in the connected-idle mode.

Other power saving modes exist that save more power, but for example the connected-sleep mode introduces an extra latency of typically 300 ms, which is more than you measure here.

Unfortunately there seem to be no official interface from Apple to change power saving modes manually, or to disable certain power saving modes. The only work around is simply to actually use the radio for something which will prevent it from going into the connected-sleep mode at all. That could be done with for example a ping running in the background permanently. Obviously this will consume more power, which could be a nuisance when running on battery.

However despite the above, you should be aware that this power saving mode isn't really something that the end-user is supposed to or normally notices at all. Remember that the latency only affects the very first packet received after the module is put into connected-sleep mode, and that it is only put in connected-sleep mode after a period of nonuse.

When using Steam In-Home Streaming you would have a constant stream of packets to/from your Mac. This means that the WiFi module isn't going to go into the connected-sleep mode while streaming.


The identity of "imap.gmail.com" cannot be verified Has anyone come across this issue?

What is going on and how do you solve it? Is pressing confirm okay?

This occurred when I went into MacBooks Notes app where I keep my notes.

Here is some of the Details when expanded:

Check your Date & Time settings in preferences. Make sure that the date is correct.


Text on center of menu bar As shown in the picture below, within the highlighted green area, is there a way to put a text in the center of the menu bar?

AnyBar with Text should do what you want. I have used the project it is forked from (AnyBar) to successfully monitor things.

This free app runs in the background and there are a variety of ways to issue it commands, including from the command line, AppleScript, or through programming languages like Go, Node, PHP, Ruby, Java, and Python.

Edited to add: Note that the text won't be in the center of the menubar, per se, but it will be toward the "inside" of the status icons on the right hand side, towards the middle.


Can ThreadSafe errors for ScriptingAdditions be eliminated without deleting the addition files? I've the following errors in my system log when running e.g. Pages:

Aug  4 19:06:50 Pages[9751]: Performance: Please update this scripting addition to supply a value for ThreadSafe for each event handler: "/Library/ScriptingAdditions/MySpeed.osax"
Aug  4 19:06:50 Pages[9751]: Performance: Please update this scripting addition to supply a value for ThreadSafe for each event handler: "/Library/ScriptingAdditions/SIMBL.osax"

What is the cause of that and how do I fix that?

As workaround, InjectEventHandler handler can be removed or commented out from Info.plist from the files:

/Library/ScriptingAdditions/SIMBL.osax/Contents/Info.plist
/Library/ScriptingAdditions/MySpeed.osax/Contents/Info.plist

Source:
https://code.google.com/p/simbl/issues/detail?id=7

In example:

--- a/Info.plist
+++ b/Info.plist
@@ -37,8 +37,6 @@
                <key>Context</key>
                <string>Process</string>
            </dict>
-           <key>SIMeleop</key>
-           <string>InjectEventHandler</string>
        </dict>
    </dict>
 </dict>

Or you can also try to set ThreadSafe to true:
E.g.

<key>OSAXHandlers</key>
<dict>
    <key>Events</key>
    <dict>
        <key>sysodlog</key>
        <dict>
            <key>Handler</key>
            <string>DisplayDialogEventHandler</string>
            <key>ThreadSafe</key>
            <true/>
            <key>Context</key>
            <string>Process</string>
        </dict>
...

  Handler dictionary keys:

  ThreadSafe - A boolean; is the handler
  thread-safe? (Event handlers only.)

  ThreadSafe OSA and AppleScript in Mac OS X v10.6 are thread-safe. If a
  script is executed on a background thread and invokes an event handler
  that is not thread-safe, it will be called on the main thread, which
  is slower than directly invoking it on the calling thread and may
  reduce application responsiveness to user input. Ideally, all handlers
  should be thread-safe. Some inherently cannot be; for example, almost
  anything that displays UI must be executed on the main thread. You are
  encouraged to either verify that your event handlers are thread-safe
  or update them to make them thread-safe.

  If the value of this key is true, then the handler may be executed on
  a non-main thread and it may be executed concurrently from multiple
  threads. If false, it will only be executed on the main thread. This
  key is required for event handlers, and must not be present for
  coercion handlers, which are required to be thread-safe. If a coercion
  handler cannot be made safe to run on background threads, the handler
  must arrange to execute the coercion on the main thread, such as using
  by using libdispatch and the main dispatch queue.

Read more:
http://developer.apple.com/library/mac/technotes/tn1164/_index.html#//apple_ref/doc/uid/DTS10003003-CH1-MAC_OS_X_V10_6__SNOW_LEOPARD__AND_LATER__INFO_PLIST

Related issues:

https://code.google.com/p/simbl/issues/detail?id=7
https://code.google.com/p/simbl/issues/detail?id=38

Other:

https://code.google.com/p/simbl/issues/detail?id=14
https://code.google.com/p/simbl/issues/detail?id=66
https://code.google.com/p/simbl/issues/detail?id=67
https://code.google.com/p/afloat/issues/detail?id=43


apple macbook pro screen doesn't comeback if we hit a key instantly after it goes to sleep I just got a Macbook pro 2014 old retina version. When the display switches off, like its going to sleep and I quickly hit a key to wake it back up. It shows a black screen with a cursor for about 15-20 seconds before the login screen appears. Its only if I do it instantly after the screen switches off. If I leave it off for sometime it comes back instantly...

Its not a problem when I don't log back in and let the screen go black from the login prompt.

I also tried to totally disable the show login screen after screensaver/sleep option and it still take a while to go from black to my desktop.

This is a problem if I have an external display plugged in or no displays attached. Its really annoying because I want  stop it from sleeping because I want to do my office work I expect it return from sleep vey quickly

If the screen is going off at the same time that the system is sleeping, you're likely seeing a delay from the system writing its hibernation files. By default, OS X sets up sleep such that if power fails, the system can restore itself when it's plugged in again.

Generally, I advise against this, but if you wish to experiment with disabling hibernation, use the following command in Terminal:

sudo pmset -a hibernatemode 0

You can restore the normal hibernation mode setting with:

sudo pmset -a hibernatemode 1

If your HDD is low on free space, writing large files will be very slow because of extreme fragmentation. Freeing up disk space can make a significant improvement in performance.

Edited to add:

A workaround for this may be to set your screensaver/display sleep time to be earlier than your system sleep time. Even if it's only by a minute or two, it will change the dynamics of your interaction with the system.


Mount a samba drive, with password from keychain I have a problem with Jettison, that tries to remount a samba drive, that is protected by a password.

It uses the following command line:

/sbin/mount_smbfs //[user]@[server]/work /Volumes/work

Of course it fails since the password is not present (nor the -N switch)

I am aware that it should contain a password, but I do not want the app to know it. So my question is:

Is there a way to request the password like this (I am aware this is not correct):

/sbin/mount_smbfs //[user]: %keychain->[identified keychain]%@<server>/work /Volumes/work

Here's how I did it

mkdir -p /Volumes/work \
&& mount -t smbfs //admin:$(security find-internet-password -D "Network Password" -l "share name" -w)@server/work /Volumes/work

The keychain access was a bit tricky, I found the answer and wrote it there. The important part was the capitals when specifying the secret kind.

You'll need to be able to create directories in /Volumes as well. This answer helped me.


How to fix an accidentally created Apple CoreStorage Volume, LVG, Logical Volume Group (broken partitions) I used Unetbootin and accidentally chose a partition on my HDD to install the Lubuntu Live-USB I wanted to create on an USB Stick.

Now, my HDD looks like this

I can boot into Mac OS X and everything works fine.

This is a 4TB SHDD. Is there any option to recreate the original settings with only one partition?

GPT fdisk (gdisk) shows the following:

Warning: Devices opened with shared lock will not have their
partition table automatically reloaded!
Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): x

Expert command (? for help): o

Disk size is 7814037168 sectors (3.6 TiB)
MBR disk identifier: 0x00000000
MBR partitions:

Number  Boot  Start Sector   End Sector   Status      Code
   1                     1   4294967294   primary     0xEE

Expert command (? for help):

gpt and diskutil output is:

    BVs-iMac-3:~ bvimac$ sudo gpt -r show disk0
Password:
       start        size  index  contents
           0           1         PMBR
           1           1         Pri GPT header
           2          32         Pri GPT table
          34           6
          40      409600      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
      409640  2728147912      2  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
  2728557552     1269536      3  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
  2729827088        1264
  2729828352  2529234944      4  GPT part - 53746F72-6167-11AA-AA11-00306543ECAC
  5259063296      262144      5  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
  5259325440  2554711695
  7814037135          32         Sec GPT table
  7814037167           1         Sec GPT header
BVs-iMac-3:~ bvimac$ diskutil cs list
CoreStorage logical volume groups (1 found)
|
+-- Logical Volume Group 28A99931-20D1-4D0C-8B5A-9872BC7270E2
    =========================================================
    Name:         LINUX
    Status:       Online
    Size:         1294968291328 B (1.3 TB)
    Free Space:   1294632738816 B (1.3 TB)
    |
    +-< Physical Volume 42D47656-F1D4-4FE4-BAB2-D572CA06D233
        ----------------------------------------------------
        Index:    0
        Disk:     disk0s4
        Status:   Online
        Size:     1294968291328 B (1.3 TB)

The following should work:

Open Terminal and enter:

diskutil list
diskutil cs list

Verify (and repair) the volume if necessary:

diskutil verifyVolume disk0s2

If a repair is required boot to Recovery Mode and repair the main OS X volume.
Delete the Logical Volume Group

diskutil cs delete 28A99931-20D1-4D0C-8B5A-9872BC7270E2

This should convert the LVG LINUX to a normal partition
Then enter diskutil list again and erase the 134 MB and the 1.3 TB partition (use the proper disk identifiers found in your listing above here):

diskutil eraseVolume Free Space disk0s5
diskutil eraseVolume Free Space disk0s4

Verify the volume again:

diskutil verifyVolume disk0s2

Check the limits of disk0s2

diskutil resizeVolume disk0s2 limits

This will output something like that:

For device disk0s2 iMac HD:
    Current size:  1.4 TB (1396811730944 Bytes)
    Minimum size:  ?
    Maximum size:  ?

Try to expand the main volume - you can't expand the volume beyond the limit shown in the previous output

 diskutil resizeVolume disk0s2 R

If the R size option fails try to use a real size like 3999g or a percentage 100% (on some external disks this may fail because of some 2 TiB limit).

 diskutil resizeVolume disk0s2 3999927271424b

or

 diskutil resizeVolume disk0s2 100%


iMessage vs SMS on command I've got a really dumb question. I just got my new (to me) iPhone 4 on a plan and activated through a service provider. Yay! My iPhone was restored to a backup of my iPod so all the data and stuff transferred, and in trying to text my mom (who is on an iPhone 5), all my texts come through iMessage unless I explicitly turn it off.

However my mom appears to be able to change messaging me between the two services on command. They all appear in the same conversation for me, but since all my messages are sent as iMessage, she has to switch to a different conversation (the iMessage one) to see my replies to an SMS.

Any idea why or how I might be able to prevent that?

I would check your address book entry on your mothers iPhone. iMessages can be registered to phone numbers, or email addresses. My guess is that because you're sending iMessages they are arriving under your email address on your mothers iPhone. Then, when she sends SMSs to you they go out under your phone number. So, check her iPhone's address book. Ensure that your entry has both your email address and phone number under the same entry.


iPhone 8 totally freezes when trying to connect to WiFi I have an iPhone 8 Plus that completely freezes when trying to connect to the internet. In an emergency situation (I can't even power off the phone to reboot it, it totally freezes up). I was having this problem on an older iPhone as well and thought it was a hardware issue but now I am convinced that it's a software problem. How can I analyze and fix this?

I'm running iOS 13.1 (17A844).

Try to solve it with:

resetting network settings
trying wifi networks with different settings
reinstalling iOS

Resetting network settings:

Settings > General > Reset > Reset Network Settings

Trying wifi networks with different settings:

try to disable bluetooth, airdrop, and cellular data first (try to activate wifi while in airplane mode)
try wifi networks with different settings like frequency, encryption, name, device vendor, internet connected/disconnected
start with unecrypted wifi, disconnected from the internet

Reinstalling iOS:

make a full backup to iCloud
make a full local iTunes/Finder backup (don't rely on single backup type)
(Tip: use an encryption - more data are backed up)
reset the phone to DFU mode
restore iOS with iTunes/Finder
setup as a new iPhone
connect to Wifi; did it help?
if the phone is now stable, proceed to reset the user data from settings and restore your backup
connect to Wifi; still stable?


Identify which apps are draining the battery on an iPhone or other iOS device for iOS 10? How to find which apps are draining the battery on an iOS device in iOS 10?

Previously in iOS 8 you could go to Settings > Battery to see a list of apps with a percentage number for rating how much battery they were responsible for using, as shown in this posting. Gone in iOS 10.

I found the Question How to check what causes iPhone battery to drain out?. But that Question and its Answers do not really describe how to identify particular problematic apps.

Be patient

That list of apps with percentages may not appear immediately.

You may need to actively use your device for as much as an hour before that list will appear. During that time you will see a message explaining that it may take “a few minutes” of usage. In my experience, that is an underestimate.


Rescuing a MacBook Pro 13-inch, Mid 2009 Would appreciate help -

I have an old MBP mid-2009 shipped originally with 10.5.7 Leopard, currently running 10.6.8. I restarted recently and found a kernel panic on startup. I have tried  booting in safe mode (unsuccessful), recovery mode (unsuccessful), reset NV-RAM (unsuccessful startup) and from an OSX install disc ("unable to install OSX on this computer"). The last option yielded an actual startup screen ith language options and a box offering the option of restoring from a TM backup (I don't have one as I did not have any important data on this machine). So broadly the machine works but never gets past the grey screen with the apple logo and the time wheel.

I have another 2 newer MBPs at home and considered using target mode to resuscitate the oldest malfunctioning mac. BTW I can't eject the OSX disc from the bad mac.

Any advice on how to revive my old Mac? I'd like to keep using it as it was fine yesterday.

Thanks.

Too late for this question, but why do people not consult Apple about Kernel Panics? Maybe you had other choices, yesterday.

My July 25 answer to similar question:

Read Apple's own support page, About Kernel Panics , and MacWorld's How To Troubleshoot a Kernel Panic. You'll be able to isolate the problem and from there, know what steps to take, many of which are quite simple.


Can I keep the Screen Sharing app from showing the menu bar? I need to use Mac OS X's screen sharing app a lot to access a remote system (also using Mac OS X). I'm new to Macs and I keep having the following problem:

If I leave my mouse cursor within roughly a fifth of the top of the screen, OS X thinks I want to exit fullscreen mode and shows the OS X menu bar.

This is very annoying as the only options I can find will allow me to choose having the remote display get resized (which is terrible if I'm hovering over a button which was just about to click) or part of my screen gets covered by the menu bar.

How can I stop the OS from trying to help me until I push the cursor into the farthest pixel in the upper right hand corner (or something like that) so that I can use the machine as a thin-client and not deal with the local system? Is there a way I could create a separate user account that only displays that application as if there's no Finder?

Before suggesting another client: I've found that you really need to use the default one in OS X or it is a poor experience.

Something that made this less annoying/painful for me was to:

Turn scaling on
Set remote monitor resolution to match exactly client resolution (laptop)
Set to follow cursor continuously

This seems to trigger the top bar pull-down less frequently, but it still happens.

Another workaround would be not using fullscreen mode, and use maximized mode instead, but that's no fun!


Macbook battery bar showing as red; battery % jumps around; battery condition normal; out of US charging I've been in Europe since 7/5. I've been charging my 2015 macbook pro (purchased in the US) in the UK from 7/5-7/11 and in Italy from 7/11-current. I use a power adapter (not a converter) since the US prongs don't fit in the outlets in the UK or Italy. I don't use a converter, and the European outlets are all 220v, but this should be compatible with a macbook.

Today, I just noticed that my battery % has been jumping up and down a bit. I also noticed that the battery bar is red despite having over 20%. I have never seen this happen before, so I'm wondering if my battery got damaged somehow.

The information in System Information is shown below, and it states that my battery is functioning normally. Any ideas what may be happening?

Battery Information:

  Model Information:
  Serial Number:    ---
  Manufacturer: DP
  Device Name:  ---
  Pack Lot Code:    0
  PCB Lot Code: 0
  Firmware Version: 702
  Hardware Revision:    1
  Cell Revision:    3224
  Charge Information:
  Charge Remaining (mAh):   1130
  Fully Charged:    No
  Charging: No
  Full Charge Capacity (mAh):   4598
  Health Information:
  Cycle Count:  837
  Condition:    Normal
  Battery Installed:    Yes
  Amperage (mA):    -1275
  Voltage (mV): 10962

System Power Settings:

  AC Power:
  System Sleep Timer (Minutes): 1
  Disk Sleep Timer (Minutes):   10
  Display Sleep Timer (Minutes):    10
  Wake on AC Change:    No
  Wake on Clamshell Open:   Yes
  Wake on LAN:  No
  AutoPowerOff Delay:   28800
  AutoPowerOff Enabled: 1
  DarkWakeBackgroundTasks:  1
  Display Sleep Uses Dim:   Yes
  GPUSwitch:    2
  Hibernate Mode:   3
  High Standby Delay:   86400
  PrioritizeNetworkReachabilityOverSleep:   0
  ProximityDarkWake:    1
  Standby Battery Threshold:    50
  Standby Delay:    10800
  Standby Enabled:  1
  TCPKeepAlivePref: 1
  Battery Power:
  System Sleep Timer (Minutes): 1
  Disk Sleep Timer (Minutes):   10
  Display Sleep Timer (Minutes):    2
  Wake on AC Change:    No
  Wake on Clamshell Open:   Yes
  AutoPowerOff Delay:   28800
  AutoPowerOff Enabled: 1
  Current Power Source: Yes
  DarkWakeBackgroundTasks:  0
  Display Sleep Uses Dim:   Yes
  GPUSwitch:    2
  Hibernate Mode:   3
  High Standby Delay:   86400
  ProximityDarkWake:    0
  Reduce Brightness:    Yes
  Standby Battery Threshold:    50
  Standby Delay:    10800
  Standby Enabled:  1
  TCPKeepAlivePref: 1

Hardware Configuration:

  UPS Installed:    No

AC Charger Information:

  Connected:    No
  Charging: No

I would start by resetting the System Management Controller (SMC) which is responsible for power management and controlling the thermal environment of your Mac. Typically this covers things like interpreting and responding to various sensors, battery charging, sleep/wake/hibernation, the power button and restarts/shutdowns, LED indicators, and so on.

To reset the SMC on your model MBP follow these steps:

Fully shut down your MBP
Press ShiftControlOption on the left side of the built-in keyboard, and press the power button at the same time
Keep holding these down for at least 10 seconds before letting go
Power up the MBP again

Once you've done this keep an eye on your battery status to see if you notice any changes.

As an aside, I note your battery has a cycle count of 837. To put this into perspective, your MacBook Pro battery has a life expectancy at or around 1000 cycles.  It's not uncommon for batteries to exceed or fall short of this number; it's just an estimation of how long it can last.   You can refer to Determine battery cycle count for Mac notebooks on Apple's website for more info.

As your battery condition is listed as Normal I wouldn't be too concerned about the cycle count yet, but you may need to think about a battery replacement in the not-too-distant future.

You may also like to take a look at How to reset the System Management Controller (SMC) on your Mac. It provides more info on what the SMC does, when you to reset it, etc.


Why do I need Wi-Fi to backup to iCloud? What is the rationale behind requiring Wi-Fi to backup to iCloud from my iOS device? What is wrong with using 3G or 4G to backup?

Without going into speculation, there appears to be no official word on why this has been done. There are a number of iCloud Backup KB articles, mentioning that Wi-Fi is the only way to backup your device:

http://www.apple.com/support/icloud/backup/

…however, per almost all Apple documentation of this sort, there is no reasoning to their decisions.

If you need to connect over 3G/4G - you can tether to another iOS device and then backups see WiFi and progress smoothly in my experience. There doesn't appear to be any opt-in choice to self-backup. http://feedback.apple.com would be the only avenue to ask for this feature going forward.


Apple AHT occasionally freezing MacBook Pro late 2011 OS X Lion Running Apple Hardware Test (AHT) repeatedly on a late 2011 Macbook Pro over Wi-Fi (Option D).

Completes the process sometimes and says no problems but sometimes freezes (has done so during RAM testing portion as well as during logic board portion of the test). Should I consider both RAM and Logic board damaged or dismiss the freezing as likely the result of flakey Wi-Fi service?

I started running the test after reinstalling Lion over Wi-Fi because the trackpad had been responding weirdly.

Using AHT over a flaky Wi-Fi connection shouldn't cause any freezing, because the required software is downloaded in entirety first, and then run.

If you've been experiencing issues with the trackpad too, you might have a hardware issue with your Mac. I would look into the issue further, maybe by having Apple look at it.


How can I have my Mac mount a network drive when an application launches? I outsourced the storage for my "iTunes Media", "iTunes Music" and "Mobile Applications" using symlinks onto a network drive.

I didn't outsource the complete media library because of performance reasons with iTunes.

It would be nice to connect to my network drive when I launch iTunes as it fails less than gracefully when the network storage isn't already mounted.

Is there a way to mount a network drive prior to a particular application launching?

Using Automator and the excellent SleepWatcher utility, I have a setup that automatically connects to my network drive when the computer starts, then automatically reconnects when the computer wakes from sleep.

I've written a tutorial in a blog post.

An update in response to CajunLuke's question:

The Automator app connects to the network drive and incorporates a 10 second delay to ensure the network connection is ready.

SleepWatcher runs as a daemon, and allows you to schedule the execution of scripts when your computer goes to sleep or wakes from sleep. In this case you configure it to run a shell script when the computer wakes that calls the aforementioned Automator app.


Where is macOS Internet Recovery stored? I read on another site that you can use macOS Internet Recovery to install macOS on a blank SSD? Where would the files be stored? On the firmware? If there any way that the firmware could be erased? (I.e. would running sudo rm -rf / on the disk also wipe the firmware or is it more complicated than that? Is there any way that the firmware could be erased?). I'm working on a disaster recovery plan incase I ran a stupid command like sudo rm -rf /.

Long Version:
The code which permits Internet Recovery Mode (i.e. a slightly modified TFTP client) is stored in the computer's firmware. (In fact, it is a part of it). It's similar to the BIOS chip on Windows computers. When you boot through Internet Recovery, it will download a recovery partition image and load it into the computer's RAM. After this process, you will be able to boot into the normal macOS Recovery interface.

Short Version:
If you were to wipe/replace your hard drive, Internet Recovery would automatically download and load a recovery partition image into the RAM, so you would be safe (as long as you have a backup of your data).

PS.
Also, it is impossible to wipe the laptop's firmware with a simple sudo rm -rf / command.

Source: Chat with Apple Support


Synced video in photos app doesn't load in airplane mode I've got a weird problem with Photos App, either on iPhone and iPad.
I have all my photos on iCloud.
On both my iPhone and iPad, I checked "Download and keep originals", in order to keep everything on the device.
That is working correctly with photos, but not videos !

For example, if I take a short video with my iPhone, it appears a little bit later on the iPad thanks to iCloud synchronization.
I can read the video on the iPad, but as soon as I turn airplane mode ON, I can't read it anymore.

This is not a storage problem as I have a lot, and I even reset completely the device, but still got the problem.
Updating to Catalina and iOS 13 didn't fix the problem too.

Apple support admits the problem, but they are not able to solve it for months...

Does anyone experience the same problem or has an idea ?

Apple Community says this:

Double click your home button and clear all open apps by swiping up. Then let’s go to settings>iTunes and app store and tap your Apple ID and sign out. Restart your device and then sign back in. Once done make sure wifi is turned on and go to the downloaded video application and make sure your downloaded content appears. Then go to airplane mode and check if the content still plays. Then clear app again and relaunch and test whilst still in airplane mode.


Can't get icon off of menu bar on mac I downloaded Fitbit onto my computer and then deleted all of it, but I can not get the icon to delete from my menu bar. I have tried to drag it over so it will delete, but it will not move.

If you have the Fitbit Connect installer software the Downloads folder on your computer, just run the Uninstall Fitbit Connect.app:

If you don't have the installer, download a new version here, then run the Uninstall app.

It is also a good idea to reboot after the uninstall process completes.


Retail Mac OS for MacbookPro 2,2? What is best OS for  MacbookPro 2,2 with new Harddisk(empty),  3GB RAM and 500GB HDD ?

Mac OS 10.6 or 10.7 Retail will work ?

ps: I am not having the Restoration DVD's came with macbook.

According to Everymac it can use anything from 10.4.8 to 10.7.5

I'd always be inclined to go for the latest OS a machine can use, even though it might make it slower than the earliest.


Should I place air holes in my custom MacBook Pro case? I'm fabricating a plexiglass case just like this to snugly fit my new MacBook Pro. I'll slide the laptop inside whenever I'm traveling for safety reasons.

It'll only be accessible from the right side. Should I place air holes in the back if it's going to be on whilst the lid is closed?

Yes, you definitely do not want to block any vents - no matter if the lid is closed or not.

You can read Apple's instructions on not blocking vents here:

https://support.apple.com/en-gb/HT202179

Note that there are vents both along the side and on the back of the MacBook Pro. Don't block any of them.


I accidentally went to Siri settings and changed the info to "Cassie" one of my contacts that isn't me. I accidentally went to Siri settings and changed the info to "Cassie" one of my contacts that isn't me. I don't want her knowing any info at all. I can't get rid of the contact so it could go back to nothing. How do I get it to go back to where she doesn't know any info?

Can someone help me?? Please help!

What you can do is:

Make a blank contact
Tell Siri you are the blank contact (Set My Info as blank contact)
Delete the blank contact

That should remove the contact from 'My Info'

To make a new contact:

Open the Contacts App
Touch the Plus sign at the top

To delete a contact:

Open the Contacts App
Select the contact you want to delete
Press 'Edit' at the top right
Scroll all the way down and press delete


El Capitan's Disk Utility won't format new 3 TB drives higher than 800 GB My iMac Mid.2010 running OS X EL Capitan v10.11.6 will not format any of my brand new 2 x 3 TB SATA drives and although I tried any other format like exFat, etc, it keeps making them no higher than 800 gigs.  I do connect each drive to the iMac with a "kdLinks HDD docking station" and a SATA-to-USB2 interface cable. The purpose is to use these 2 drives for Time Machine backups. What am I doing wrong?

Update:

Also:

2017-01-14 12:59:38.663 defaults[9465:6786462]
The domain/default pair of (/Library/Preferences/com.apple.TimeMachine.plist, MaxSize) does not exist

Also from mount:

/dev/disk0s2 on / (hfs, local, journaled)
devfs on /dev (devfs, local, nobrowse)
map -hosts on /net (autofs, nosuid, automounted, nobrowse)
map auto_home on /home (autofs, automounted, nobrowse)
/dev/disk1s2 on /Volumes/OLDisk (hfs, local, journaled)
/dev/disk2s2 on /Volumes/SATADisk2 (hfs, local, nodev, nosuid, journaled)

Your problem is probably related to the 2.2 TB (or 2 TiB) limit. Your disks either have an MBR (instead of a PMBR) or it's a limitation of the firmware of the kdLinks HDD disk station.

Check the disks after getting their disk identifiers with disktuil list with sudo gpt -r show diskX with diskX the disk identifiers of the external disks (e.g. disk1 and disk2).

If you get an output like this:

gpt show: /dev/disk1: Suspicious MBR at sector 0
      start       size  index  contents
          0          1         MBR
          1          1         Pri GPT header
          2         32         Pri GPT table
         34          6
         40     409600      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
     .....

destroy the MBRs and add a proper GUID partition table.

To destroy the MBR and restore a proper GUID pt use:

diskutil umountDisk diskX
sudo dd if=/dev/zero of=/dev/diskX bs=512 count=1

Destroy the GUID partition table and create a new one:

diskutil umountDisk diskX
sudo gpt destroy diskX
sudo gpt create -f diskX

with diskX: once more the disk identifiers of your external disks.

Be sure to use the proper diskX or you may accidentally delete valid disks!

After removing the MBR you often/sometimes have to completely eject the drive (or reboot your Mac) for the changes to take effect.

Update:

With your partition data posted one can definitely say it's a 2 TiB problem:

The default size of the disk is 5,860,533,168 blocks. Your gpt output shows a size of 1,565,565,872 blocks. The difference is exactly 4,294,967,296 blocks which are 232 blocks or 2 TiB.


How do I move widgets on the Dashboard that are out of the viewing area? I have a couple of widgets in Dashboard that moved outside of the viewing area. I can only see them in Mission Control.

How do I move them back?

Just try to remove them (Manage widgets...) and than add again to dashboard.


When does a mac laptop startup automatically after a power failure? I'm trying to get the hang of this.  I notice that sometimes when I plug the charger the macbook boots automatically, other times it doesn't.  I know in desktop macs this is determined by a setting in Energy preferences, but not sure when this is supposed to happen with macbooks. Does it change with the model? It's good to know this for troubleshooting.  Any insights would be much appreciated.

Regardless of of the Mac model, the power settings determine if it will boot upon power failure.  If this option isn't set, it won't boot.


Epson software update keeps popping up on my screen but nothing gets downloaded I get that question pop-up on my screen a few times per day. Sometimes several times in a row. If I say Yes, a long EULA document appears for me to accept, then a window with a progress bar that reaches about half the way before I get this:

When I go to Software Update, nothing appears in the list. All my software is up to date.

Selecting No closes the dialog but it may reappear again in seconds.

I got tired of this, removed my printer from Print/Scan settings, used Epson uninstaller utility (found on their site) to remove their drivers and software from the system, rebooted the machine, plugged in my printer back and OS X downloaded drivers and installed them again. All was well for about a week. Today this started again. Any insight into fixing this would be appreciated.

Just talked with Epson support. I had already removed the printer from System Preferences > Print & Scan, but when I tried to add the printer back it said the software could not be found. In talking with Epson this what he had me do:

I had already removed the printer so do this first.
Open System Preferences > Print & Scan, right-click in the list of printers on the left, and choose "Reset printing system..."
Run the Software Update under the Apple menu. (Being Mountain Lion this opened the App Store application. However, there were no software updates for me.)
Restart computer.
Open System Preferences > Print & Scan and add the printer again.

It was able to add the printer, and now the dialog box in @King Julian's post is not showing for me. Hope this works for others too.


repair disk - unmounted encrypted disk partition In Yosemite 10.10.2 after verifying my startup disk in disk utility I got this message...

"This disk needs to be repaired using the Recovery HD. Restart your computer, holding down the Command key and the R key until you see the Apple logo. When the OS X Utilities window appears, choose Disk Utility."

As per instructed I rebooted in recovery mode and tried to repair the disk from there. The problem is that in recovery mode my startup partition shows up as "unmounted encrypted disk partition", and all options including verify and repair are greyed out. The core storage volume can be repaired but it comes up clean.

What do I do, is this problematic? My computer appears to be running smoothly in general, I just verified the disk out of curiosity and now I'm faced with this issue.

If your main partition is encrypted it will not be unlocked and mounted after booting to Recovery Mode.

After starting Disk Utility you have to unlock the volume first. Then enter the FileVault2 password. The volume will be mounted automatically after entering the proper password.

Now verify or repair your main volume.


Is there a way to stream live video from an iPad to an Apple TV? AirPlay is a great feature for stream audio/video to iOS devices, but can you stream live video? For example, instead of recording the video and then streaming it, can you just stream on the fly? I want to shoot video with an iPad and stream it to an Apple TV on the same network.

Mirroring the default camera app essentially works for just video, but since audio is not being capture, there is no audio sent to the Apple TV. What are my options?

I haven't tried it yet but according to these articles Ustream will enable you to do it:

Ustream Launches iPad-Optimized iOS App, Adds Apple AirPlay Support
UStream for iPad


Connection issues with iPod touch I have one year old iPod Touch. All of a sudden YouTube is not working. I have wireless network at home.

It says "Cannot connect to YouTube". I'm also facing this issue when I connect to Gmail. it says - "Cannot connect to imap...". but still I can see my mail.

I guess it shouldn't be issues with wireless or n/w connectivity because Safari browsing is working fine.

I had a similar issue for a few weeks.  I found that the problem was with my firewall.  Even though I had told the firewall to allow all traffic to and from my ipod, it still didn't work because the firewall slowed down the internet tremendously.


iOS in-app purchase: Keeping consumable counter in keychain, do I need to document export compliance The answer to iPhone - in-App purchase consumable correct approach on stackoverflow is very appealing for keeping track of consumables in the keychain. However, using the keychain for this purpose (not username/password), will it trigger the need to document export compliance?

The general consensus I've heard is no, it does not trigger export compliance. The OS is the one handling the encryption, not your app.


How to change a note background in the preview app from transparent to any other colour? When I add a note to a highlighted text (right click - Add Note), the background is transparent, which makes it difficult to read because it overlaps with the PDF text (example screenshot below). I know this does not happen when I add a note directly without linking it to a text. I could do it that way, but I prefer to have comments linked to a specific text I select. Does anybody know how to make the background not transparent? Thanks in advance.

First click the note, then press the button shown in the picture and select a color.


How do I downgrade Java on OSX 10.6.8? Software Update recently updated Java with update 6, for my 10.6.8 installation. My problem is that my bank here in Costa Rica uses a dated version of Java, and now my version of Safari (5.0.5) acts wonky when the Java applet for accessing my bank account online loads, rendering it unusable.

Is there a way to revert back to the previous update of Java on my machine? Thanks for any help!

If anyone still cares about downgrading Java on Snow Leopard, the answer that advises removing Java manually and reinstalling from download or Snow Leopard DVD doesn't work for Snow Leopard, but it can be made to work.

Instead of using the freestanding Java packages on the DVD, use the app Pacifist to open the main Snow Leopard installer .pkg. Then search for "java" and install every item that matches (you can skip the JavaScript items, obviously). This fixes the error reported in the linked article (which is offline but available at archive.org):

"Error occurred during initialization of VM
Unable to load native library: libjava.jnilib"

Apparently there are additional pieces to a functioning Java install not included in the separate .pkg files.


Unhide invisible files from the command line By default, a number of system directories (such as ~/Library) are hidden in OS X (ie. they don't appear in Finder):

I know I can do this through the GUI but I would like to add a script to my dotfiles that does this automatically for certain system directories.

Is it possible to remove the hidden flag for a file/directory from the command line?

For files hidden by prepended .
To show:
defaults write com.apple.finder AppleShowAllFiles YES; killall Finder

To hide:
defaults write com.apple.finder AppleShowAllFiles NO; killall Finder

edit: as per RikerW's advice, to shorten these long strings into some shorter strings, add the following line to ~/.bash_profile from your favorite text editor:
alias showall='defaults write com.apple.finder AppleShowAllFiles YES; killall Finder'
alias hideall='defaults write com.apple.finder AppleShowAllFiles NO; killall Finder'

do note that you will have to do source ~/.bash_profile to update your shell with the new aliases.

For files hidden from the GUI:
To show:
sudo chflags nohidden /path/to/file

To hide:
sudo chflags hidden /path/to/file

Do bear in mind that this completely removes the hidden flag.


Restore Trash (~/.Trash/)? I accidently deleted the ~/.Trash/ folder. How I fix this?

I do not want to:

Restore files currently in the Trash can
Restore files emptied with the Trash can

Open Terminal.app and type

mkdir ~/.Trash

It will create a new empty folder that Mac OS X can use to store trashed files; this won't save any old deleted files from the original .Trash folder you deleted.


Airport extreme seems to place a limit on gigabit ethernet I have a gigabit internet which goes into my airport extreme. Everything is working fine now except the fact that the Gigabit Ethernet port has a limit of 200mb/s when tested. If I plug the main internet cable into my computer and test the download goes to 900+mb/s but when I plug it into Airport extreme and connect to it's (gigabit) ethernet I hit that 200mb/s limit no matter what.

I tried with different cables and whatnot, the ethernet is limited. Any ideas?

After hours of pulling my hair out I'm going to answer my own.

TL; DR: Airport Extreme (at least the 2013 edition which I own) is crap for gigabit networks.

It's advertised gigabit ports cannot go over, after much testing, 205mb/s because of the WAN to LAN routing which is horrible.

This is a decent wireless router but overpriced for what it offers in terms of range and Ethernet performance. If you buy a gigabit internet do not make the mistake and buy it because it can't go faster than those 200mb/s.

As I said, after much reading and testing, your best bet is with a device that has hardware routing and I strongly recommend you take a look at this page for comparisons of various devices in terms of "WAN to LAN Throughput".

I just ordered a ASUS RT-AC87U which seems to offer a great signal and solve my gigabit issues. I will update this answer once I receive it and manage to do some testing.


Can't start Xcode - stuck on installing state I was trying to upgrade Xcode because it didn't let me upload to apps to iTunes Connect.

Now it's stuck in installing state (few hours) and doesn't start:

Xcode is being updated
Xcode can not be opened while it is being updated.

what do to?

There is a small progress bar under the Launchpad icon in the Menu Bar.

You can also see the current download progress by hovering over the icon.

Wait for it to end.


MacBook Pro problems with sleeping I have two screens.  I have a MacBook Pro and just installed Mountain Lion. When I close the lid, instead of completely sleeping, it simply moves what I'm doing to the secondary screen.  Please explain?

After Lion, closing the lid puts the machine straight into clamshell mode rather than putting it to sleep, if an external display is connected and the laptop is connected to AC power. I'm not aware of any way to change this.

See Apple's page on clamshell mode behaviour, comparing 10.6.8 and Lion: http://support.apple.com/kb/HT3131


Can't delete apps that are no longer available in App Store I have four apps that are no longer available in the App Store. They're not installed on my phone (which is fine). Every time I connect my iPhone to I get this message in iTunes: "Some of the apps in your iTunes library were not installed on the iPhone because one or more errors occurred."

In iTunes I can search for the app and the icon is grayed out:

Click Install does nothing.

I've searched for these apps on the App Store and they're not there. How do I remove all four of these apps to avoid getting that message when connecting my phone to my computer?

The apps didn't have .ipa files in my system, which may have been part of the problem. What I ended up doing was a search in iTunes (the global search at the upper right corner of the app) for each one. In the results, there is an icon with three dots, clicking on that icon brings up a contextual menu with the option to delete.

That error message I was getting before no longer appears after that.


Clear all messages from current Terminal session In a Terminal window, if I issues a "clear" command it clears the screen.  But if I scroll up, the messages are still there.

Is there a way to clear call completely?  Currently, I have to close and reopen the Terminal again to achieve this.

To completely clear the screen in Terminal, so there is no scroll back, you can either use the menu and click Edit > Clear to start or use the keyboard and press: command-K


How do I stop Alfred from stealing command+shift+\? I use the program Alfred2, unfortunately it keeps trying to steal the keyboard shortcut CMD+SHIFT+\. How do I stop it from doing so? It conflicts with other apps such as Aperture.

Apparently, one of the workflow hijacked the shortcut. Has nothing to do with Alfred itself.


Uploading an edited preferences plist to a non-jailbroken iPhone running iOS 7.0 I want to change a setting in one of my iOS device's plists, and upload it to the device without doing a full restore from backup.

How can I extract the file from an unencrypted backup on my Mac?
How can I upload the modified file to my device?

You can do it with i fun box for mac. Go here http://i-funbox.com/ifunboxmac/


wrong scaling for external HD monitor using VGA, MBP 13" I know this sounds similar to other questions but bear with me - I've investigated and am not finding any solutions. Sorry in advance for a lengthy question.

I have a MacBook Pro (13-inch, 2016, Two Thunderbolt 3 ports.) Since I purchased it in summer 2016 I've used it with a couple of different cheap HD monitors by Samsung, connected with the Apple thunderbolt-VGA multi-adapter. This has never been an issue.

A few days ago, I cracked the screen. (That's another story.) I'm a developer and have to keep using this machine heavily for the moment (My backup 2012 iMac would have a hard time keeping up with the current tasks.) It continued to work just fine in "clamshell" mode with an external mouse and keyboard.

This evening though, I opened the MBP lid to see if I could access its camera. Suddenly, the external display resolution defaulted to 800x600. The "scaled" options in Display preferences now allow for 800x600 and 1280x1024 only.

Only by option-clicking the "scaled" radio button in Display preferences can I access the monitor's native resolution of 1920x1080 (this has never been necessary before.)

(and now the meat of the question:) When I do select the full HD resolution, the image is almost correct, but asymmetrically narrowed - leaving a black bar of, I don't know, maybe 120px on the left side and 40px on the right. It's almost usable, but causes a definite headache.

Moreover, the exact same problem occurs with a different monitor! It certainly seems like a software/firmware issue on the MBP itself.

Has anyone else experienced this?
Could it be somehow due to the cracked Retina display? (If so, how??)

Things I've tried:

resetting the SMC
resetting the PRAM
disconnecting all peripherals besides the VGA adapter

Things I haven't tried:

booting into safe mode (I'm worried I'll be stuck not seeing anything at all on the external display.)
using an HDMI adapter (I never bought one for this machine.)
swapping the VGA cable (will do)

I'm a bit at a loss and would appreciate any ideas or reports of similar behavior!

ok, replacing the VGA cable worked.

and - apologies - it appears to be the same issue/solution reported here:
External monitor randomly lowers resolution adds black borders

and here:
External monitor viewport appear shrunk in native resolution on MBP


Unwanted 'Favourites' folder in Photos App When viewing a photo I clicked on the heart icon in the iPad photo app by mistake and a Favourites folder was created.
Although the photo was deleted from the Favourites folder, the empty folder remains. Has anyone any idea how to remove the empty Favourites folder.
Very annoying to have it there with nothing inside it and no obvious way to remove it.

I am answering my own query - I found out that the empty 'favourites' folder disappears about a week after all its contents have been deleted. Problem solved with no intervention.


How can I use AppleScript to type text into a new window? I'm trying to make an applescript that will write itself into a new window of Applescript Editor. But I can't figure out how it will paste itself with quotations. The code I have right now is

tell application "System Events"
    keystroke "n" using command down
    keystroke "tell application (System Events) keystroke (n) using command down end tell"
end tell

Quotes that are meant to be literal need to be escaped with a backslash and instead of using keystroke, use the following example to create a new AppleScript document containing the wanted code:

tell application "AppleScript Editor"
    set text of (make new document) to "tell application \"System Events\"\n\tkeystroke \"n\" using command down\nend tell"
end tell

Copy and paste the code example above into a new AppleScript document and press the Compile button.  It will then look like:

tell application "AppleScript Editor"
    set text of (make new document) to "tell application \"System Events\"
    keystroke \"n\" using command down
end tell"
end tell

Then press the Run button and it will create a new AppleScript document containing the following:

tell application "System Events"
    keystroke "n" using command down
end tell

Which if you then press the Run button of this new document, it creates a new blank AppleScript document.

Note: Depending on the version of OS X/macOS the tell application "AppleScript Editor" line may be tell application "Script Editor".  You can still paste the example code, as is, into Script Editor and is will automatically remove the Apple portion from AppleScript to show as tell application "Script Editor".


MacBook USB Hub with mini displayports I have the new 2015 MacBook. I am trying to find a HUB (or Docking Station) can can allow me to hook up two 4K Displays while supplying power to the MacBook.

I don't care if it uses HDMI or mini Display but my searches on the Internet tend to show mini Display is the way to go for 4K display.

I was a backer for HUB+. The HUB+ has been cancelled in their latest update.

But there are other projects available like HydraDock, Pluggable and OWC USB-C

Aside from Plugable's Unfunded Kickstarter Campaign, I don't see any solution to have 2 4K displays at the same time.

From Pluggable's web site

  The Plugable Ultimate Dock utilizes two unique yet complimentary
  technologies:

  USB 3.1 Type-C supports a feature called “VESA Alternate Mode” which
  works with the built-in graphics processor on supported systems to
  provide video output at resolutions up to 4K. The other two display
  outputs in the Ultimate Dock are enabled by the DisplayLink DL-3900
  graphics processor, which can support two additional 1080P displays at
  60Hz.

Their Kickstarter failed so I am not sure if they will ever manufacture this item. I assumed OWC is doing the same thing or something similar to drive the displays.

USB doesn't have direct access to a GPU. Driving two 4K displays would be quite difficult, if at all possible. In all honesty, if you wanted to drive two 4K displays, the new MacBook was NOT the computer you should have purchased. It can barely handle its own display.


How to add sites to the Safari Power Saver exclusion list? In Safari, a feature I really like is that flash plugins are automatically blocked by default and you have to click in order to start the flash plugin (see, e.g., http://mac-fusion.com/manage-the-safari-power-saver-feature/). I found, however, that it prevents Google Play's "play music" buttons from working, so I had to temporarily disable the feature (uncheck the "Stop plug-ins to save power" box) and restart Safari in order to listen to music on Google Play.

There is some sort of exclusion list. I currently have 3 sites listed, but I do not know how they got there. How do I add a site, e.g. play.google.com, to this list?

I don't see a UI to do this, but perhaps there is a way of editing a plist to insert a new entry?

Thanks to Thecafremo's tip, the responsible file is ~/Library/Safari/PlugInOrigins.plist.  I found an AppleScript published by GitHub user crmne (Carmine Paolino), SafariPowerSaverWhitelister.scpt, that is supposed to add entries (https://gist.github.com/crmne/5855a901a0a9a6ef30a5).  You might try it, but it did not work for me in Safari 7.0.3.

Instead, after clicking on a "play music" button, I opened up Web Inspector and ran the following JavaScript on the console:

window.embedElem = document.querySelector("embed");
embedElem.style.position = "fixed";
embedElem.style.width = "100px";
embedElem.style.height = "100px";
embedElem.style.top = "500px";

There was a 100x100 black square hovering on the left of the page toward the bottom.  After clicking it, Safari added an entry to the exclusions list for play.google.com.


How do I maintain two different iOS devices on a single iMac My wife and I share an iMac, and our iPhones keep populating with each other's apps. iTunes keeps trying to update my phone with my wife's apps and data. Is there a way to update the settings on the phone so it can distinguish the difference between App Store accounts?

Easy way: create multiple user accounts on your Mac, a tutorial can be found here.

-or-

Hard way: create different iTunes libraries for your user account.  You'll need to:

Quit iTunes
Hold down the Option key and then launch iTunes
Click the "Create Library..." button on the dialog that is displayed
Once you've created the different libraries, you need to remember to use the Option key and then "Choose Library..." to switch between the two every time you start iTunes

A multi-part tutorial can be found here.


Confusion in understanding data fork, resource fork and the MachO file format when viewed all together Note: I am a newbie to the OS X world. So please take it easy if I ask something noobish.

According to what I have read/understood: MachO's file layout consists of a header, load commands and data segment that contains either executable instructions or data. But after reading about fork s(data & resource) I am confused.

Confusion: In HFS files are not monolithic and doesn't consist of single segment. Apple Mac files usually exist out of two files the data fork and resource fork.They have an identical name and are shown by Mac as a single file. The resource fork contains the code of the program in execuatables.

How did I ponder here? I copied a file named filename from a Mac to my pendrive and opened it on Windows result 2 files ._filename and filename.

Question: Where do these forks fit in the file layout? There is no mention in the file layout about the forks. Are these two forks integrated to make a final mach file? Can the ._filename (resource fork) have malicious code?

The ._filename file does not only contain the resource fork, it also contains Finder metadata, in AppleDouble format.

The resource fork itself can be viewed on an HFS volume by opening filename/..namedfork/rsrc. Forks and other extended attributes can be listed by using ls -l@.

Resource forks are not specific to the Mach-O format (and I do not know if they are used at all for it), they're a feature from classic Mac OS which was extensively used for classic application files, and could store things like string tables, bitmap images, etc.

Malicious code can be hidden anywhere, a virus scanner should be able to detect it even if it is hidden in a resource fork.


"Natively" add emails to Mail by PHP pipe script I found this awesome tutorial on how to send emails on localhost that will open your Mail showing you the email that was sent from PHP, however this is slightly annoying getting Mail to open when an email is sent - I have some tasks that run in the background which sends an email for development reasons for my site so I can test the emails.

I want to be able to not get annoyed by getting popped up with emails, instead I would like it to pipe it to Mail and show in my inbox when I click "Get new messages" so I can look into the email whenever I want not at the instant when the email is sent.

I've looked into where Mail stores their email ~/Library/Mail/V2, I was wondering if I could adjust the script to add the email there, but it looks quite complication so I don't want to risk having any confusion or corruption happening.

Is there any possibility to store the mails without any problems so Mail can add it to my inbox list via PHP?

Anything?

You can do what you ask, but it requires a Mailbox > Rebuild operation. That asks Mail to scan the ~/Library/Mail directory you found and rebuild its email header database from the files it finds there. I doubt you'd find that acceptable.

I'm afraid Gerry's comment above is the right way to go about this: set up a test email account somewhere, use one of the many PHP-to-SMTP methods you can find online, and point Apple Mail at that email account.

Perhaps the simplest, most Apple-like way to achieve that end is with OS X Server. It gives you a configuration UI for the Postfix SMTP mail server built into OS X. Setup through the Server GUI is about as easy as you can hope for. You can create a private user account, and be assured that your test emails won't ever even leave the machine. As cheap as OS X Server is these days, it's pretty much a no-brainer.

If you absolutely have to do this for no cost, you can configure Postfix by hand. The configuration GUI you get with OS X Server is helpful, but not strictly necessary.


Why different Bluetooth headsets pair in different ways on iPhone? I used to pair my Bluetooth headset to my iPhone in the "standard" way using the Settings app. The pairing goes like the following:

Open Settings → Bluetooth, and turn on the headset:

Wait for the headset to appear, and tap on its button:

The headset is connected:

Recently I got a new Bluetooth headset, and I found that it pairs in a different way, which goes like the following:

Open Settings → Bluetooth, turn on the headset, and a "Bluetooth Pairing Request" dialog pops up automatically:

Tap on the "Pair" button, and the headset is connected:

I think the second way of pairing is a little more convenient. What makes the pairing procedures for the two headsets different? Is the new headset using some kind of advanced Bluetooth technology?

What makes the pairing procedures for the two headsets different?

Quite simply, the Bluetooth version is what determined the pairing capabilities.

Is the new headset using some kind of advanced Bluetooth technology?

In short, yes.  That Sony WF-1000XM3 earbuds are Bluetooth 5 compliant and if you’re using an iPhone 8 or newer, it’s also utilizing Bluetooth 5.
So why the difference?  Basically the protocol it uses to advertise its services. Bluetooth 5 supports LE (low energy) extended advertisements.  Basically, when close enough, the device will advertise to a discoverable device like your phone “I’m a headset.  Would you like to pair?”  Which is why it seems so simple.
It gets even easier when you utilize NFC in which you actually “touch” the devices together and the Bluetooth connection manager assumes you want to connect so it just looks for a confirmation To pair - yes or no.
I couldn’t find specifications for the Xround Versa because their website is quite limited, but I would guess that it uses Bluetooth 4.0 or even earlier resulting in the different experience.


How to invoke a method at particular time asynchronously every day in Mac application? This is my first Mac application.

I would like to send emails by comparing the current date and saved date of clients by the user in sqlite only one time- every day depending on the condition, asynchronously.

Note: I'm assuming that by "asynchronous" you mean "do this whether or not the user is logged in and running the application at 9:30 am".

The right way to do this is to register a call with launchd that handles the appropriate work for your application. When and how you do this is somewhat flexible. If you're using a .pkg-type installation script you can register the helper on installation. Or you can register on first run of your application, perhaps after the user has provided sufficient configuration information for the helper app to do it's job.

The Daemons and Services guide delves in to how to do this in great detail. I recommend reading that. And for a description of plist properties that launchd looks at see this manual page.

As a very high-level example,  let's assume your helper application can be found in your package under MyPackage.app/Contents/SharedSupport/bin/myhelper. Here's a plist file that would launch it every day at 9:30 am and 9:30 pm on the machine:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <!-- This label needs to be unique to the system -->
    <key>Label</key>
    <string>com.mycompany.mypackage.myhelper</string>

    <!-- Toggle to true to prevent it from running -->
    <key>Disabled</key>
    <false/>

    <!-- This is the full path to the helper application -->
    <key>Program</key>
    <string>/Applications/MyPackage.app/Contents/SharedSupport/bin/myhelper</string>

    <!-- This is an array of string arguments to pass in to the app when it's called -->
    <key>ProgramArguments</key>
    <array>
        <string>--daemon</string>
    </array>

    <!-- This works much like cron to state when the job should be run -->
    <key>StartCalendarInterval</key>
    <array>
        <!-- Run at 9:30 am -->
        <dict>
            <key>Minute</key>
            <integer>30></integer>
            <key>Hour</key>
            <integer>9</integer>
        </dict>
        <!-- Run at 9:30 pm -->
        <dict>
            <key>Minute</key>
            <integer>30></integer>
            <key>Hour</key>
            <integer>21</integer>
        </dict>
    <array>
</dict>
</plist>

Save that in /Library/LaunchAgents/com.mycompany.mypackage.myhelper.plist on your machine and then type:

sudo launchctl load /Library/LaunchAgents/com.mycompany.mypackage.myhelper.plist

To register it right away with launchd. On reboot it should register automatically. See the launchctl man page for more information on using it to interface with launchd.


Is my Mac Mini HDD about to fail? I carried my Mac Mini while traveling a few times, once to a different country and couple of times to different cities.

I once noticed the hard disk inside makes noise like its about to fail. But the noise is not noticeable unless the room is very very quiet, or when I keep my ear on the Mac Mini hardware and I can clearly hear the creeking noise from HDD.

But running disk verify shows no error. Will the apple store replace it for me due to bad health of the HDD? I am still under warranty.

I suggest taking a backup and going to an Apple Store soon.

I had two situations like this with funny creeking noises, the hard drive eventually slowed down and stopped working - no bad sectors or anything. It just eventually stopped.

It was not an Apple drive, but I am sure it's worth asking. Worst case scenario you will have to come back when drive eventually dies.


How can you get Finder to sort by name, but also sort folders before files? When I want sort my files and folder in Finder (specially sort by name) they sort all item by name mixing folders and files together. I want a way that sorts (like Windows) first all folders by name then all other items by name. How can I do this?

There's no built in feature in the Finder to achieve that, but with the "plugin" TotalFinder you can get that. It's located under the "Tweaks" tab in the TotalFinder settings.

Edit: There was a screenshot here, but it was out of date. Look at Robsofts answer instead for an up-to-date screenshot!


Syncing iTunes between 2 accounts on the same computer I have 2 accounts (home and work) on my MacBook, and would like have both accounts accessing the same iTunes library.

I have some success by putting the iTunes Library in the public folder of my home account, so my work account can access the same files too. However, what I would like is to have my Podcasts sync as well.  So that when I plug in my iPhone, I can sync my Podcast regardless which account I am on.

Any idea how to do that?

It seems this is not entirely possible as per this Apple discussions thread:

https://discussions.apple.com/thread/1521856?start=0&tstart=0


how to connect 4 laptops to one monitor I am trying to connect video from 4 laptops to a big screen monitor and be able switch from one to another easily without having to connect and disconnect cables.

Thanks

Unless your monitor supports 4 inputs, which most don't, you'll likely need a switch.

Presuming your laptops all have Mini Displayport or Thunderbolt out, this will work.


MBP won't startup, disk is full I've used Migration Assistant to move my old user account from Windows to Mac. After a while the disk on my Mac being full. Now the Mac won't startup

I've tried to enter in Safe mode, but it doesn't start.
I've tried from Recovery mode>Terminal but there is follow error: no space left on device.

I haven't another Mac, only a PC.

How I can access to Mac disk and delete some files?

The first thing to do is backup your data, although if you were migrating from the PC to the Mac, then you've probably already got an original copy there anyway.

If you have a backup, then probably the easiest thing to do is create a bootable external drive, boot your Mac up from that, and then delete files from the internal drive.

If you have an external USB hard drive, you can start up from macOS Recovery to format it and install macOS. More specifically, you have the following macOS Recovery options:

commandR to reinstall the latest macOS that was installed on your Mac, without upgrading to a later version
optioncommandR to upgrade to the latest macOS that is compatible with your Mac
shiftoptioncommandR to reinstall the macOS that came with your Mac, or the version closest to it that is still available

Broadly speaking, follow these steps:

Boot up into macOS Recovery using one of the options above
Use the Disk Utility option to erase/format the external USB drive (NOTE: This means you will lose all data on it. Another option is to use a USB Thumb Drive of at least 8GB in size, although this will probably be a lot slower).
Once it's formatted, install macOS. (This will take a while).
Once complete, boot up from the external drive by holding the option key during startup and then selecting it to boot off.
Once booted up into macOS from your external drive, your Mac's internal drive should be accessible as if it's an external drive.
Delete files from the internal drive. (Note: You will want to ensure you have at least about 9GB of free space in order for macOS to function properly. However, my recommendation is that you generally was to have no less than about 15% of your drive's capacity free).
Make sure you don't forget to empty the Trash (Finder > Empty Trash...)
When you've freed up enough space, go to Apple > System Preferences > Startup Disk and make sure you've selected the internal drive as your startup disk
Shut Down your Mac (Apple > Shut Down...)

Barring any other issues, you should now be able to boot up from your internal drive.


Help with waiting while a process is running I'm looking for a bash script that checks if the Installer process is running and waits/pause if it then proceeds once the process is no longer running.

Here is what I have so far:

 #!/bin/bash
 PROCESS="Installer";
 PID=$(ps -A |grep -m1 "$PROCESS" | awk '{print $1}');
 while s=`ps -p $PID -o s=` && [[ "$s" && "$s" !='Z'  ]]; do
     echo "$PROCESS is Running, waiting for it to close"
     sleep 1
 done
 echo "$PROCESS is not Running";
 SCRIPT HERE

I took your script and changed

Changed the PID assignment to pgrep
Changed -o s= to -o stat= for ps
Removed the unnecessary ; at the end of some lines

It's a bit hard to test, but something like

#!/bin/bash
PROCESS="Installer"
PID=$(pgrep "$PROCESS")
while s=`ps -p $PID -o stat=` && [[ "$s" && "$s" != 'Z' ]]; do
    echo "$PROCESS is running, waiting for it to terminate"
    sleep 1
done
echo "$PROCESS is not running anymore"
SCRIPT HERE

should work.

If you are not worried about the Installer getting into Zombie state you could rely on the fact that ps exits with 1 if no process is found, and significantly simplify the loop condition.


Open last used folder in finder Often I find that I want to open the previous or last folder that I worked with in finder. Say I'm saving something to a folder from my camera, I then go to gmail and click attach, it would be great if there was a "previous" or "last folder" button that takes me to where the photos are. Am I missing something, is there a hidden OSX feature that does this?

The "last folder" option can be found under Go -> Recent Folders Finder menu. There's a list of recent folders opened in Finder not just the "last folder".


iCloud storage is almost full I have an iPhone 4 and an iPad 2.  I've only had the iPad for three weeks, and iCloud is almost full.  How can I free up space?  I prefer not to buy more space.  It looks like the iPhone is using most of the space.

Go to Settings > iCloud > Storage & Backup > Manage Storage > under "Backups" select the device you want to free up space on (i.e. "Jim's iPhone"). Go through and turn off different apps that you would like to not backup to iCloud. You can also see the applications that store data in the cloud (i.e. Camera Roll) and how much space each application has in cloud. This should show you where you can go to delete things and free up space. Or you could just turn off that apps backup.

The iCloud backup list sorts applications with the greatest users of backup space are sorted to the top of the list, so you can quickly assess whether you can thin out the content or need to either purchase more backup space or perhaps disable iCloud backups and instead back up to iTunes and then delete your iCloud backups to allow the space there to serve document sync and email storage.


Creating iOS app preview in iMovie but getting iTunes Connect Error I'm creating an app preview for an iOS app using Apple's instructions (record video using QuickTime, import into iMovie, File -> App Preview) yet I get the following error message when I attempt to upload the video:

"Your app video preview is in the wrong format. For more information, see the Developer Guide".

The video is Mpeg 4, 640x1136 etc. so this seems odd. Has anyone been able to upload a video in this way?

Here is a trick using just iMovie and Quicktime to get the right dimensions.

Use QuickTime to record a short clip from the size of the device you need
Use iMovie and insert that clip into a new "App Preview" project
Add your actual video after the short clip

Now, any clips that you export will be in the right dimensions.

If you need to hide your short clip, you can shorten it to 0.1 seconds. Put a title over it and delete the text. Now your video starts with 0.1 seconds of a black screen.


How does Twitter or Vine remember login credentials in between of installations? If you install Twitter, or Vine, equally, then you log in, then uninstall the app, then install it again, it somehow appears already logged in. I've got several ideas about how this might work, but they all are dismissed by various reasons:

associate a unique cookie with the device itself, but that seems to contradict the App Store TOS (I don't know; I've written "seems", so I'm not stating it), and it will sustain after the device has been sold, so this approach is hardly viable;
store the login data somewhere in the cloud, but, as far as I know, all iCloud records get wiped along with app uninstallation;
use OS keyring, but I doubt there is such an API.

For one, Telegram messenger always installs fresh so you have to log in again after each installation.

That said, how does Twitter or Vine do this?

The iOS Keychain is not deleted, when the app is deleted. So if the keychain still contains the necessary credentials the app can just log in.


Finder Window flash and disappears on unminimize You can clearly see what's wrong with Finder in the GIF. When I click the Finder window, it appears to restore the window, and then it's gone. This usually happens after a while. It's very annoying, a quick fix is to Force Quit Finder, and I can restore those windows again.

There is only 1 Desktop spaces enabled
I have tried removing ~/Library/Preferences/com.apple.finder.plist
My MacBook's version is macOS Sierra 10.12 latest version. If my memory is correct, I have seen this kind of problem before updating to Sierra (when I was using El Capitan)
I also tried removing the saved state from ~/Library/Saved Application State/com.apple.finder.savedState

Is there anyway to fix this? Please tell me if more information or log files are required. Thank you.

After Finder window disappear on unminimize, press Cmd-Ctrl-F. The Finder window (and Safari window too where there is the same problem) reappear and go to full screen. Press Cmd-Ctrl-F one more time and it returns to normal size.


How to add icons to the Opera browser's toolbar? I'm a longtime Opera user, and, now that I'm moving to Mac, I want to install Opera on it.  On Windows and Linux, I can add icons to the toolbar - such as turn images on/off, control the zoom, wrap the text. Yet, on Mac, with the latest Opera (26), there doesn't seem to be any way to edit the toolbar.

How can I add icons to the toolbar?

From Opera Help pages:

Customize toolbars

You can change the appearance of a toolbar by adding items, changing where or when it displays, changing the style and wrapping, or returning to its defaults. To do this, Ctrl-click the toolbar and select "Customize". The toolbar is highlighted by a yellow border and you can start customizing the toolbar in the following ways:

To add an item, such as a button or search field, select "Appearance" and in the resulting dialog, click "Buttons" and drag a new button from the list for any toolbar to the highlighted toolbar.
To change where the toolbar displays in the browser, select "Appearance" and change the Placement setting.
To change the style of the toolbar, for example, to use text rather than buttons or images, select "Appearance" and change the Style setting.
To change the wrapping of the toolbar, select "Appearance" and change the Wrapping setting.
To set the toolbar to display only when it is needed, select "Appearance" and check "Show only when needed". This is especially useful for the navigation bar.
To undo any changes you made and reset a toolbar to the default setting, select "Reset Toolbar to Its Defaults".
To remove an item from a toolbar, select "Remove from Toolbar".
To change the order in which toolbar buttons or icons appear, drag-and-drop the buttons or icons.
To change the size of the buttons on all toolbars, select Tools > Appearance > Skin and in the "Icon Size" field, select the percentage to scale the buttons.


Can I reference a hundreds value of a number from a cell in Apple Numbers? For example, A1 has 12,345.00 I want A2 to output 345.00. Is this possible?

You can use the module function for this. In A2 enter

=MOD(A1;1000)


On Yosemite Safari opens randomly, why? and how can I stop it? On Yosemite, I don't use Safari at all. Never.
Every now and then (like once a week or so), Safari automatically opens, without my interaction and it does not even come to forefront, it just remains in the background, and I notice it when I go to the dock to open something else and notice it is there.
It appears to just want to connect to apple home page (no suspicious tabs or anything that I can see).

Anyone has any suggestions?

I was having the same problem, about twice a day. I installed Little Snitch to see what servers were involved, and I noticed a Dashlane server was one of them. I disabled the Dashlane extension in Safari and it hasn't happened for the last 24 hours.