How to remove unwanted text from a string? I have an applescript that returns the title from a website, the only issue is, it also contains lots of unwanted HTML (I think?). Most of the time, I can overcome this by removing the common characters using the following code.

on CharacterRemover(inputString, ReplaceChar)

set TID to AppleScript's text item delimiters
set AppleScript's text item delimiters to ReplaceChar
set pieces to text items of inputString -- break string apart at commas
set AppleScript's text item delimiters to "" -- or whatever replaces the comma
set inputString to pieces as text -- put string back together using whatever
set AppleScript's text item delimiters to TID

return inputString

end CharacterRemover

set FirstTitle to "<!-- react-text: 45 -->“<!-- /react-text --><!--
react-text: 46 -->Megan Fox<!-- /react-text --><!-- react-text: 47 --
>”<!-- /react-text -->" --the format of the returned title
set FirstTitle to CharacterRemover(FirstTitle, "-")
set FirstTitle to CharacterRemover(FirstTitle, ">")
set FirstTitle to CharacterRemover(FirstTitle, "<")
set FirstTitle to CharacterRemover(FirstTitle, "!")
set FirstTitle to CharacterRemover(FirstTitle, "/")
set FirstTitle to CharacterRemover(FirstTitle, "reacttext")
set FirstTitle to CharacterRemover(FirstTitle, ":")
set FirstTitle to CharacterRemover(FirstTitle, "”")
set FirstTitle to CharacterRemover(FirstTitle, "“")

set z to 0

repeat 10 times
set FirstTitle to CharacterRemover(FirstTitle, z)
set z to z + 1
end repeat

set FirstTitle to CharacterRemover(FirstTitle, " ")

display dialog FirstTitle

However, since this code removes the numbers, when I get titles such as

<!-- react-text: 477 -->“<!-- /react-text --><!-- react-text: 478 -->iPhone 8<!-- /react-text --><!-- react-text: 479 -->”<!-- /react-text -->

it returns as "iPhone" instead of "iPhone 8"

edit: on the website "higherorlower.com" I am using javascript "document.getElementsByClassName" to return the title of the given search amount

any ideas to overcome this?

I would advise you look at (and, if you wish, feedback about) the method you're using to retrieve the information from the website, as the best and most reliable option would be to use a different method such that you don't have to deal with the ReactJS comments at all.
If you'd included that part of your AppleScript along with the rest, it might have been a chance to solve your problem at its source.
Nonetheless, here's one method of stripping the tags from your text strings, though by no means the only method, nor necessarily the most graceful or efficient.  But it's reasonably clean and, presuming the tags are all simple ReactJS comment tags, it will do a reliable job.
    set string1 to "<!-- react-text: 45 -->“<!-- /react-text --><!-- \nreact-text: 46 -->Megan Fox<!-- /react-text --><!-- react-text: 47 -- \n>”<!-- /react-text -->"

    set string2 to "<!-- react-text: 477 -->“<!-- /react-text --><!-- react-text: 478 -->iPhone 8<!-- /react-text --><!-- react-text: 479 -->”<!-- /react-text -->"

    stripTags from string1 --> "“Megan Fox”"
    stripTags from string2 --> "“iPhone 8”"
    --------------------------------------------------------------------------------
    to stripTags from s as text
        local s

        # Eliminate linebreaks and join to form one line of text
        set the text item delimiters to {null, linefeed, return}
        set s to the text items of s as text

        # Use bash to isolate all the various tags within the string
        # Note: not suitable for tags with irregular content, such as
        # any that unexpectedly contain '<' or '>' as part of their
        # text content.  However, that shouldn''t be an issue here.
        do shell script "egrep -io -e '<[^>]+>' <<<" & the quoted form of s

        # Use the tags as a basis for elimination using AS's TIDs
        set the text item delimiters to {null} & paragraphs of the result
        set s to the text items of s as text

        return s
    end stripTags

string1 is a copy of your variable FirstTitle, including the line breaks that it contained (I'm not sure whether these were in their intentionally or an artefact of when you copied your script over into the browser); their presence or absence doesn't affect the efficacy of my script, but merely necessitated the two lines at the start of the stripTags handler that gets rid of them.
string2 is the text you supplied at the bottom of your question.
I've shown the output of each of these following processing.  I retained the double so-called "smart"-quotes that are part of the string and lie outwith the tags; I did see that you had opted to eliminate them, but their presence here—merely for demonstration purposes—are a nice visual reassurance that the script targets only the tags, and preserves the text in between.  I hope you don't mind if I leave those smart-quotes for you to deal with as you wish.
Let me know if you have any queries.
ADDED 2018-05-12:
@cjeccjec Thank you for updating the website information with the correct URL.  Tip for next time: include the code you're using to get the title.  It'll be easier for people to help you and it will attract more help as well.
Luckily, this problem seems quite straightforward.  Using getElementsByClassName() is a good idea, and you even managed to identify the classname of interest, term-keyword__keyword.  Well done.
The elements assigned to that classname are <p> elements.  They do have a title property, but it's empty, so I suspect that's not what you're using nor what you're after at all.
They also have a property called textContent, which, as it suggests, returns the text contained within the element, i.e. the labels of the items being compared in this game.  I believe that's what you're after, and it's completely free from ReactJS tags.
This code returns an array of the textContent properties from the three loaded p.term-keyword__keyword tags on the site at any one time: the two currently visible and in play being compared; and one off-screen to the right waiting to scroll into view for the next comparison.
    Array.from(document
              .getElementsByClassName('term-keyword__keyword'),
               e=>e.textContent.slice(1,-1)
              );

I also took the liberty of slicing off the quotes from the beginning and end of the texts.
Incorporate this into AppleScript like so:
    tell application "Safari" to set labels ¬
        to do JavaScript "Array.from(document" & ¬
        ".getElementsByClassName('term-keyword__keyword')," & ¬
        "e=>e.textContent.slice(1,-1));" in the front document

    --> {"Microsoft Word", "Moobs", "Malaysia"}

    item 2 of labels --> "Moobs"

Those were the results that I got returned whilst playing the game.  I was trying to guess whether "Microsoft Word" or "Moobs" had more internet searches, which I got correct; then "Malaysia" scrolled into view as I already knew it would.
Using this method, you don't need to strip any ReactJS tags away, nor any quote marks.


Cannot establish HTTPS connection My OSX Lion MacBook Pro suddenly seems to be unable to connect to any website via HTTPS.  HTTP works fine, but HTTPS seems to just time out.  Using netcat:

Mithril:~ mitch$ nc google.com 80
GET /
HTTP/1.0 302 Found
Location: http://www.google.ca/

But if I try the same thing on port 443, the request just seems to sit there forever.  Trying to access any HTTPS website with Chrome gets me a message that the server took too long to respond.  Safari seems to wait forever, but never get anything back.  I'm also seeing some SSL errors in the Console:

11-12-21 11:47:59.621 AM [0x0-0xc4cc4c].com.google.Chrome: [62652:24579:633336744818573:ERROR:ssl_client_socket_nss.cc(1536)] handshake with server www.google.com:443 failed; NSS error code -5938, net_error -107
11-12-21 12:13:14.404 PM [0x0-0x18c08bf].com.adiumX.adiumX: cdsa: SSLHandshake failed with error -9806 (connection closed via error)

A quick Google search reveals that I don't seem to be the only one with this problem, but I can't access half the results because discusssions.apple.com requires HTTPS.  The ones I can access have been entirely unhelpful.

I don't have any parental controls turned on, and other devices on the same network have no trouble connecting via HTTPS.  What's going on?

Have you tried rebooting? Sometimes it's a Keychain problem. Try opening the Keychain app, and see if it hangs. If it is so, repair permission with Disk Utility and then reboot. It worked for me (happened twice on my MBA).


Is swipe to archive possible with non-Gmail account in iOS? Is it possible to configure which folder to put mail in when swiping on a email to archive/delete with a non-Gmail account?

My objective with this would be to file email into an archive more easily than tapping Edit->Move->ArchiveFolder. This is currently possible when you set up a Gmail account on your device but not with other accounts.

This can now be accomplished very easily in iOS 7.

(n.b. The following assumes that you have already setup your account on the iOS device. These steps described are for a generic IMAP account. Also, when ALL CAPS are used below, it is to reflect how Apple has it listed in iOS 7.)

Launch the 'Settings' app on your iOS device
Scroll down and then tap on "Mail, Contacts, Calendars"
Tap on the email account you want to configure.
Tap on the 'Account' line with the > at the top of the next screen
On the 'IMAP ACCOUNT INFORMATION' screen, scroll all the way down until you see 'Advanced' and tap on it
Now you will see a 'MAILBOX BEHAVIORS' screen, showing you which mailboxes are used for Drafts, Sent, Deleted, and Archive mailboxes.
Important: Tap on the 'Archive Mailbox' line and verify that you have chosen the correct folder on the server where you want messages to be saved.
Once you have verified that the Archive Mailbox points to where you want it to go, look for the 'MOVE DISCARDED MESSAGES INTO' section, and tap 'Archive Mailbox' (instead of 'Deleted Mailbox')
Important: These changes will not be saved until you properly exit the configuration screen. To do this, tap the '< Account button near the top of the 'Advanced' screen.
When you get back to the 'Account' screen, tap 'Done' at the top-right corner.

If you'd like a step-by-step guide with screenshots, I have created one and made it available at: http://share.luo.ma/TUAW/guides/Archive-Email-Instead-of-Deleting.pdf


How to create your own wifi network in mac without internet cable I want to create a network in my room with my mac. I have low wifi signal in my room and my ipad cannot detect it but my mac can. However, I am using a retina mac and thus cannot connect the ethernet cable. Is there any way that I could partition my air port to create a network while connected to my home wifi?
FYI I am using a late 2013 retina macbook pro with the OS X mavericks

Unfortunately you can't use your Macbook to extend your wireless network in this way. It seems to only be able to connect to an existing Wi-Fi network or create its own. It can't extend an existing Wi-Fi.

Three options are:

1) Purchase a Thunderbird to Ethernet adapter so you can connect the Macbook to the network over ethernet and then share the ethernet connection over wireless.

2) Connect your iPad to your Macbook by USB cable and then share the Wi-Fi connection over "iPhone USB".

3) Share the Wi-Fi connection on your Macbook over "Bluetooth PAN". This last one is probably the most attractive as it doesn't involve using a cable of some sort.


Mac keeps warning me about the battery problem on the top bar My Mac (2017 12' MacBook) keeps me warning about the battery problem when I tap on the battery icon on the top bar. It showed battery repair (the exact English phrase might be different) with a warning icon.

However, I'm not sure what is the problem of the battery in my MacBook. Currently, the battery cycle is 829 and the manufacture date is 2017-06-19. Is it just that the battery is consumed too much and Apple encourages me to change to a new one or is there a serious problem with the battery?

If there is a real problem, how can I detect it and what should I do? The battery swap is quite costly (over $100) so I would rather like to avoid it (well, I'm fine with buying a new laptop but the problem is Apple ditched 12' MacBook).

When you see the "Replace Battery" warning icon, it's because your Mac has detected an issue with the battery and it needs to be replaced.  You can continue to use your Mac with no problem, but understand as the battery degrades, you'll get less and less charge meaning you'll be tethered to a wall outlet more and more.   The only time you really need to worry is if the battery starts to swell.

This is based on information it's getting back from the battery's on board chip that stores information like cycle count, current maximum charge, the initial maximum charge, etc. as well as measurements and calculations the MacBook is doing.

  Currently, the battery cycle is 829 and the manufacture date is 2017-06-19.

This is normal.  Batteries have a lifespan of about 1000 cycles and a life of 3 to 5 years.  This one is a bit on the early side of the curve, but not unexpected.  These numbers are derived from testing and modeling - there's no way to say that a battery is guaranteed 1000 cycles and exactly 4 years of life.

  Is it just that the battery has consumed too much and Apple encourages me to change to a new one or is there a serious problem on the battery?

No.  Apple doesn't "encourage" you to change your battery after a specified amount of time/cycles.  You're getting this because the battery is no longer capable of supplying the amount of charge as spec'd out by Apple.

What could cause it?

failing/defective battery cell
buildup of the SEI layer (normal wear)
exposure to temperature extremes
physical damage

What is it exactly?  It's impossible to know.  We don't have the ability to "peer into" the battery pack and look at all the conditions in there (well, we do in the lab, but not in the computer).  The best we can do is take some measurements and make an educated guess - that's what the computer is doing when you get the battery health info.

Replacing the Battery

Typically Apple (and ASRs) will replace the entire top case of the MacBook.  However, if you have some technical skill (or know someone who does) and some patience, you can replace the battery itself; iFixit.com has excellent instructions


Different countries do not show up? If someone outside of the US buys an IAP or gives a review, do those not show up in the USA app store?

Nope, the review will be posted to the app store where you are logged in. For example, if you are logged in to the Irish App Store, the review will only appear under the Irish app store for that particular app.


What does the model number refer to? There are two different "model numbers" for Apple products.

For example, the Apple TV 4K has:

MQD22LL/A
A1842

Which is the "model number" and what is the other number called?

A… is a model number, referring to the model of device.
M… is a part number, referring to a specific configuration of a model.

For example, for devices with various configurations such as whether a device is unlocked and international, the model number will be identical to a US device but the part number will differ.


Can't connect to iPod: iTunes claims iPod Touch needs passcode entered At some point my daughter entered the wrong passcode too many times on her iPod Touch 2nd gen.  I'm trying to reset the iPod as follows:

Unplug the cable from the ipod
turn the iPod off by holding down the sleep/wake button and dragging the red arrow across the screen
Hold down the home button and connect the USB cable to the iPod
Keep holding the home button until the "connect to itunes" screen comes up

The problem is directly afterwards itunes always complains, stating "itunes could not connect to the iphone because it is locked with a passcode. You must enter your passcode on the iPod before it can be used with iTunes"

The issue is that the iPod is stuck at the "connect to itunes" screen so I cannot enter the passcode.

I have the solution for you here.

Plug the iPod into iTunes
Hold the power and home button together until the screen goes black
Let go of the power button, keeping home pressed
after 10 seconds let go.
open iTunes and click restore iPod.

you have a blank iPod, and will need to sync again

Update (from original poster)

These steps are correct, I had to actually go to the Genius Bar to find that out because the instructions on Apples own site are not correct.  Specifically they do not recommend the two-button shutdown, but rather a regular shutdown which does not work.

More details here: http://codesweattears.blogspot.com/2011/12/putting-your-ipod-touch-into-recovery.html


Unlocking iPad Purchased from Government I have an iPad that was purchased from a previous employer (government local council). I have tried to factory reset it, but when setting up, I am told that this needs to be completed by the administrators for the council that I used to work for. Is there anyway of getting around this, without talking to the administrators from my previous employer?

Governments tend to use MDMs, or Mobile Device Management systems. So the only way to deal with this is to get them to remove the device from their MDM. The only way to do that would be to talk to them.
If, of course, you purchased this iPad legitimately, there would be no issue in doing this. There would be a process in place for removal of a device from MDM.


iCloud Drive not downloading files after reset I'm on a 2016 MacBook Pro with macOS High Sierra 10.13.5. Yesterday, due to the huge amount of 'Purgeable' storage present on disk, the system started to 'purge' it, freeing about 200GB of space. In doing so it also apparently removed many local copies of the iCloud Drive files (I have Documents and Desktop sync'd), as the little cloud appeared next to many of them.

At the same time the Finder started to try and upload 22GB of files (crazy because they were all up there in iCloud Drive).
I sought help from Apple and they make me deactivate iCloud Drive (which created a folder with all my files -except for the iWork and similar files, in the Home folder).

Upon reactivation iCloud Drive is not making any progress with the download... files are not reappearing.. folders neither..
The 'expert' said that if I paste the iCloud Drive (Archive) folder inside it will only create duplicates.

What can I do? How can I solve this?
My last resort is to back restoring the system from Time Machine but I would like to know why iCloud Drive is not downloading the files.

Thank you very much

I see you've resolved your situation, but I wanted to write up a formal answer.

When you enable iCloud Drive, it has to go through a (very slow) process for each container of files before they show up. Each App Folder is one such container, and then all standalone files including Desktop and Documents goes in a generic container.

If you have lots of files (10+ GB can cause this to start happening) it can take hours (or days) before the files show up, even though they haven't even started downloading. In this time sync will not finish. If you have just enabled iCloud drive (either on a new computer or because you had turned it off) and you have a lot of files, trying to leave it plugged in etc. may help it go faster. Do not try to turn it off and then on, because it'll just start over.

I'm not sure why this happens, but it's the way it works right now. So if you don't see files after turning it on, let it sit for at least a day or two of having proper power and internet connection before trying other things.


Delete apps from Launchpad or from Finder? Is there an advantage to delete apps from Launchpad (Hold one app like in iOS) vs from finder?

And why some apps cannot be deleted from Launchpad?

Deleting apps from Launchpad and Applications folder are similar but for an extra step. When you delete from Launchpad, MacOS removes it completely from  your system.
From Finder(Applications folder), you move it to Trash and have to empty the trash to completely delete the app and generate space out of it.

Those apps which cannot be deleted from LaunchPad (without X) are apps pre-installed by the OS and needed by it or apps that you have installed separately using a DMG file from third party like Google/ Mozilla FF.

Rest apps which can be deleted are apps installed from AppStore.


Enable HiDPI on 23" iMac? I have a 23" iMac running Lion (10.7.3). I've checked that the "Enable HiDPI display modes" checkbox is enabled in "Quartz Debug" (it was checked the first time I opened it), but there are no HiDPI resolution options in my display settings.

Has anyone had success with using HiDPI display modes on a 23" iMac?

Per the instructions on the screen, you have to log out and back in when enabling or disabling HiDPI mode for the changes to take effect:


Will Mac Mini work with Dell Inspiron Laptop I am interested in buying the new Mac Mini as I cannot afford a Mac book or Air. The laptop I have is Dell Inspiron 3537. So I wanted to know is it possible to connect Mac Mini with my Dell laptop.
Any help will be appreciated.

VNC

You can use VNC on your Mac to show the screen on your Windows or Linux laptop:

  VNC is an abbreviation of Virtual Network Computing. VNC is a common protocol that allows computers to both share and to offer control over the network. Using VNC you can connect to and see your computer remotely; great for remote working or helping a relative perform tricky tasks without needing to be in the same location.

  Mac OS X includes a built-in free VNC server. You can set up and use VNC on your Mac without needing additional or third party software.

There are numerous Windows and Linux VNC clients you can use on your Dell laptop.

Also see answers to these related questions:

Is it possible to use a Mac Mini with a laptop monitor?
Use Dell Inspiron laptop monitor as only monitor for mac mini


How to push only with iCloud photos I have a friend who owns a iPad and iPhone, and a Windows PC. We are using iCloud to sync pictures between the lot.

What we would like is for all images / pictures taken on the iPad and iPhone to push a copy up to the iCloud photos.

What we would also like is for the devices to not pull anything down.

The issue is, he has 10k pictures in his iCloud Photos and this is too many images on his handheld device.

Is this possible? I went into the settings app and then ICloud but could only see options for sync.

iCloud Photo Library only does a full sync. Your friend might want to consider switching to something like Google Photos where a full sync isn't forced.


What exactly happened with Apple throttling iPhones? I'm doing a business report on Apple Inc. and I'm on the legal issues section and I have to list and describe a few recent (last ~5-10 yrs) issues/lawsuits that the company faced. So far a major one appears to be them throttling old iPhones, and from what I've searched it seems that this was caused by an iOS update of some sort that slowed phones, preventing them from abruptly shutting off. So people thought their phones were defunct and bought new ones, while they didn't know they simply could've replaced the battery. Thus, lawsuits were filed. Am I right on this?
Any correction/clarification would be appreciated. Providing any other major lawsuits/cases against Apple would also be appreciated. Thanks!

Some say throttling.
Others say the system stays running until you can have the battery serviced.
You are right. Lots of opinions and people taking action without learning the physics and basics. If Apple had been more open what was happening sooner, the lawsuit might not have succeeded to reach class-action status, but laws can be horribly flawed (slavery, death sentences, chopping off fingers or hands for instance). In the US pretty much anyone can sue and sometimes settling is smart to avoid risk of an adverse finding and not an admission or merit or guilt.


What is bound at port 53 of localhost and how to stop that service? I want to run my own bind dns forwarder but in order to bind it to port 53 of my machine I first need to stop what is running there.

It seems that a service called "domain" is running there from what I found:

$ nc -vz 127.0.0.1 53
found 0 associations
found 1 connections:
     1: flags=82<CONNECTED,PREFERRED>
    outif lo0
    src 127.0.0.1 port 52950
    dst 127.0.0.1 port 53
    rank info not available
    TCP aux info available

Connection to 127.0.0.1 port 53 [tcp/domain] succeeded!

What is that service and how can I stop it?

The command
lsof -i TCP:53
will give the active sessions on port 53.

The command
netstat -vanp tcp | grep 53
will give information on the processes that are listening on port 53. The 9th column gives you the process ID (PID).

To get from the PID to the program name you run:
ps -p <PID>. Which will give you what application is running under this ID.

You can string these command together as

netstat -vanp tcp | grep 53| awk '{print $9}' | xargs ps -p

As for killing the process, you can always run kill -9 <PID>. But I'd recommend finding out what program is running and why. It might be back up after a reboot.

A similar question was asked at
Kill TCP connections on a Mac in Terminal .


Don't copy songs into iTunes folder just use them from file system I need to add songs into iTunes Library but I don't want to copy songs into library. While drag and drop just copies all songs which needs to be added to the Library folder and then uses it. So, we have waste of space twice, from where we copy songs and to where we copy them. But I don't want to copy songs into Library folder, I just want to add it into Library and play or sync with iPhone. So, at only one place all songs can be managed.

In iTunes > Preferences > Advanced

Uncheck Keep iTunes Media folder organised and Copy Files to iTunes Media folder when adding to Library

Screen shot provided by @Wheat Williams:


Break RAID0 to have separate drives I have an enclosure Hornettek Dual Bay SATA Case with removable disk trays, and RAID0, RAID1. USB3.0 and eSATA dual bay case with two 2T WD drives. My idea was to set them up as separate drives to have 2 backup drives.

Accidentally I formatted both drives as one. I guess that created something like a RAID0.

I want to break that, to be able to have the backup system I need. Disk Utility is not helpful, as even though the enclosure is set as Port Multiplier, my Mac will still read the drives as one single drive & volume. Can I separate them with Terminal?

It is safe to completely delete them as I still have not copied any information onto them?

When I use diskutil this comes up:

/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.3 GB   disk0
   1:                        EFI                         209.7 MB   disk0s1
   2:                  Apple_HFS Macintosh HD            499.4 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
/dev/disk1
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *4.0 TB     disk1
   1:                        EFI                         209.7 MB   disk1s1
   2:                  Apple_HFS Untitled                4.0 TB     disk1s2

So disk 1 are the two 2T WD.

This isn't an issue with OS X itself, it must be the enclosure that's combining the drives. If it was a software RAID, you would see the drives as disk1 and disk2, and the combined volume as disk3. It's possible that the enclosure's software is refusing to destroy the combined volume because it's partitioned and breaking it apart would result in data loss (although in your case obviously not). I suggest deleting the partition on there and trying to separate them in the device-specific software again. If that fails, try physically taking out one of the drives, configuring the other one on its own, and only then adding the second one.

Have you tried both eSATA and USB modes to see if there is any difference? (assuming you have a spare eSATA port)

I'm unfortunately not familiar with Hornettek and its devices, so I can't make any more specific suggestions than that.


Issues after macOS Sierra upgrade I recently updated to macOS Sierra on my MacBook Air. I have started noticing that desktop applications will startup automatically.

I have noticed this with Facetime and Slack. Whenever I access Facebook via Google Chrome, Facetime tends to open up and when I access Slack in the browser, the Slack desktop application starts up.

I have checked that I have not set any shortcut keys and it keeps happening frequently. Has anyone else noticed this issue? What can I do to stop it?

Be sure you do not have any OS updates left: Upgrade OS X operating system

Be sure your Google Chrome is up-to-date and check Settings -> Extensions

Let me know


Portable UI Applescript for choosing any menu item through any hierarchy of sub-menus At the bottom of this page Apple explains how to use UI scripting to automate selecting menu items.  There are two hardcoded examples that I'm drawing on in an effort to write a generic library script for use in a number of projects that can choose any menu item from any menu through any hierarchy of submenus.

The TL;DR version of this question is: How do I do that?

But for some more detail, if desired...

...I've made some progress, and come up with a few approaches for this but each of them has one fatal flaw or another...

Option 1.

If all the parameters are text or lists of text:  eg:

on ChooseMenuItem(theApp, theMenuName, theSubMenusNamesList, theMenuItemName)

which might be called with eg:

ChooseMenuItem("TextEdit", "Format", {"Font", "Ligatures"}, "Use Default")

then I can use a bunch of text parsing and concatenation etc. -- including a repeat loop through  the theSubMenusNamesList parameter to carefully construct a script in a string something like "tell menu ... click ... tell menu item ... click ... tell menu item ... click ..." etc. and then:

run script theScript in AppleScript

Voila!  And this works.  Except when any of those parameters - particularly the menu name - doesn't exist.  eg. trying to connect or disconnect a bluetooth device through the bluetooth menu extra.  So...

Option 2.

If the menu is nameless then let's change theMenuName to theMenu and pass it in by reference.  eg:

tell application "System Events" to tell process "SystemUIServer" to set theMenu to (menu bar item 1 of menu bar 1 whose description contains "bluetooth")
...
ChooseMenuItem("SystemUIServer", theMenu, {"Magic Keyboard"}, "Connect")

Note, here theMenu variable and parameter as opposed to theMenuName.  After performing the set statement, theMenu variable is not text, it's an AppleScript object, something like:

menu bar item 6 of menu bar 1 of application process "SystemUIServer"

Proceeding from here this fails one of three ways.

2a. If I try to construct a script that includes: tell theMenu ... it tells me, not surprisingly, that ...the variable theMenu is not defined.

2b. If I pull theMenu out of the quotes: "tell " & theMenu & "..." or "tell \"" & theMenu & "\"..." it errors with: Can’t make «class mbri» 6 of «class mbar» 1 of «class pcap» "SystemUIServer" of application "System Events" into type Unicode text.

ie. it can't coerce the aforementioned menu bar item 6 of menu bar 1... into text (unlike in Option 1 where I could call the menu by name).

2c. If I try to pull theMenu's tell statement out of the constructed text script so theScript text variable is something like tell menu item ... click ... tell menu item ... click (without the initial tell menu ... click) and then:

tell theMenu
    click
    run script theScript in AppleScript
end tell

then it tells me the variable "click" is not defined.  I believe it's referring to the first "click" in theScript variable that run script is trying to ... well ... run. run script... can't seem to pick up any context from where it's called from, or if it can I haven't figured out how.

Option 3

I've tried to think through how I might somehow include actual tell menu item theSubMenuName ... statements (ie. not text strings of the same that I then try to run) inside the above-mentioned repeat loop, but since it's a hierarchy of tells I can't quite figure out how to make that work.  Maybe there's a recursive solution here, but my brain's hurting too much to figure that out.

Conclusion

So, I'm at a loss... I can't figure this out, but I also can't believe there isn't a way to do this.  My inclination is that there has to be some way to refer to menu bar item 6 of menu bar 1 of... in my theScript variable somewhere... but how?  Or if really not that, then some other ultimate solution here?

After wrestling with this for days before posting the above question, it looks like I figured out a solution - I think the act of actually describing the question in detail to post it got my thinking to there.

I'm sharing it for the benefit of anyone else hitting something similar...

My struggle was with the idea that the hierarchical nature meant increasing the level of tell for each item in theSubMenusNamesList.  I couldn't figure out how to put that in a loop without each iteration of the loop going in at that level but then having to come back out at the same level, thus not going deeper.

This was where Option 3 was a fail from the start, which had me going down the rabbit hole of trying to construct the script in text, to then run with run script.

However, Option 3 is actually the answer - code it direct without trying to construct it in text - but I had to wrestle with that some more to get there.

I eventually realized that I can put each iteration's subMenu into a variable - set to menu item ... of the previous iteration of itself. That successfully goes deeper into each level of the hierarchy without pulling out too early.

Of course if that doesn't make sense, then here's the code, which you're welcome to steal and adapt of course, and which may or may not make more sense... ;)

on chooseMenuItem(theApp, theMenu, theSubMenusNamesList, theMenuItemName)
    set theAppName to the name of theApp
    activate theApp
    tell application "System Events" to tell process theAppName
        tell theMenu to click

        repeat with theMenuName in theSubMenusNamesList
            set theMenu to menu item theMenuName of menu 1 of theMenu
            tell theMenu to click
        end repeat

        set theMenuItem to menu item theMenuItemName of menu 1 of theMenu
        tell theMenuItem to click
    end tell
end chooseMenuItem

This works for me - tried with a number of different options. For example: As in the original question, call it with something like:

ChooseMenuItem("TextEdit", "Format", {"Font", "Ligatures"}, "Use Default")

Or an example with no sub menus at all, just leave the third parameter as an empty list:

ChooseMenuItem("TextEdit", "File", {}, "New")

Hope this helps someone.


How to upgrade RAM of MacBook Pro 15-inch, Mid 2012 I want to upgrade my MacBook Pro 15-inch, Mid 2012. It has now 8 GB of RAM. I want to upgrade it to 16 GB.

Any suggestion on how to do this are greatly appreciated.

macsales.com aka OWC is a fantastic website for buying RAM. I purchased 16 gb for my late 2011 model with no problems. Order the RAM amount that you want, then when the ram arrives you must unscrew the back cover of your macbook and find the RAM to remove, which you will then replace with the RAM you bought. I highly suggest watching a YouTube video on the correct procedure to do this, as it is virtually impossible to describe the process in words. Search on YouTube: installing RAM MacBook Pro. Good luck!


How to cancel Mac store update? Is it possible to cancel a paused app update? There is no cancel option in the App Store; only resume is there.

The secret is OPTION key.
Press that and that resume button will turn in to cancel.

http://www.cultofmac.com/224342/cancel-instead-of-pausing-your-mac-app-store-updates-os-x-tips/


Inkscape (or other XQuartz) window disappears when using external screen I have this issue where Inkscape does not appear when my MacBook Pro is plugged to an external screen. I tried several windows management tools (like Spectable, or Stay) but these did not work for the XQuartz app.

It seems like the issue is that when I plug the external screen, it messes with the coordinate system of my Mac's screen, effectively shifting the origin of my screen by the resolution of the external screen.

In other words, from the point of view of XQuartz the origin of my Mac's screen changes from 0,0 to 2560,1440 (which is the resolution of my external screen).

This means that if Inkscape is somewhere near origin (0,0) but still associated with my Mac's main screen then it doesn't appear on the external screen nor in my main screen. It is basically in "limbo" between the 2 screens.

The solution is to move the Inkscape window to a new coordinate that takes into account the size of the external screen, and this is where wmctrl comes in useful:

brew install wmctrl
wmctrl -r Inkscape -e 0,2560,1440,1200,700

Of course you need to replace 2560,1440 with your own external screen's resolution and 1200,700 to suit your main screen resolution.

In order to make it more convenient I created 2 alias, to fix the coordinates for my Mac screen and for the external screen, respectively:

alias fixInkscape='wmctrl -r Inkscape -e 0,2560,1440,1200,700'
alias fixInkscapeExt='wmctrl -r Inkscape -e 0,0,0,2560,1300'

Remember that each alias only works for the screen that Inkscape is associated with, you still need to drag-and-drop the window in order to switch screens. wmctrl won't do it automatically, but it certainly helps in "fishing" it from limbo.


Yosemite and SSD Trim incompatibility I added an OWC 240GB SSD to my 17" MBP a couple of years ago and installed Trim Enabler. Everything was dandy until yesterday when my computer somehow updated itself to Yosemite and I was faced with the "grey screen of death". I had an empty external drive already hooked up so I went ahead and installed Yosemite on it and copied up my latest Time Machine backup onto it. Starts up fine but I need to get my SSD back online. After researching I figured out that Trim Enabler and Yosemite were now bitter enemies.
I am just trying to figure out now how to "disable" Trim Enabler from the SSD. Since I can't access the drive through Disc Utilities I'm not sure how to go about doing this. Do I have to take the drive out and hook it up as an external to disable Trim Enabler? Will that even work? I've since come to find out that Trim Enabler isn't really even necessary on the OWC Mercury that I have.

Help please!!!

Thanks!

See my answer here:

Since the release of 10.10.4, Apple now provides a new tool called trimforce, allowing users to activate TRIM also on unsupported disks. So now you can do:

sudo trimforce enable


How do I add a new google contact on an iPhone? I’m trying to add a new contact on an iPhone to a google account. I can go to contacts.google.com in safari and add it there, but is there a way to do that with the contacts app? I have google contacts synced in mail accounts settings. I’m not sure where my contacts are actually being saved, is it iCloud?

If you have already enabled the toggle for your Google account to sync contacts, you only need to set your Default Account in your iOS Contacts settings to be your Google Account. Then, when adding contacts they will automatically be uploaded to your Google Account.
Source: https://www.makeuseof.com/tag/sync-iphone-contacts-to-gmail/


How do I share a post in the Facebook app for iPad? My mom uses the Facebook app for iPad and wanted to share a post, such as on the web interface:

How does one share a post within the app?

You cannot re-share posts from the iOS Facebook app.

You can re-share posts if you:

Browser to https://www.facebook.com/ in mobile Safari
Log in
Click the three bar icon in the upper left hand corner to bring up the side bar
Scroll to the very bottom of the side bar
Click the "Desktop Version" link at the very bottom of the side

This will give you the full Facebook desktop web view and from here you can re-share posts in your timeline.


Why do so many IMAP providers not work properly with Mail.app? I've been using Mail.app to read my email since 1992 or so, back when it was called NeXTmail. I'm generally pleased with it. Lately, though, I've been having a problem with the IMAP implementation, and specifically with Dreamhost. The problem that I'm having is that Mail.app sometimes doesn't notice when new mail is added to a mailbox, and the only thing I can do is "rebuild" the mailbox. This is a problem. Why does it happen? Is there an email provider that doesn't have these problems?

Well, gmail doesn't have the problem, but it has bother problems.

So I would like to understand why this is happening and what I can do about it. Is there an IMAP server that's better than Courier (which is what Dreamhost is using)? Thanks

You might want to avoid things like Notes, Calendars & Reminders as these try to create folders on you IMAP server and put data from your Notes.app and Calendar.app in those folders that the IMAP server may not like. At least from Lion up, when you setup email from the System Preferences, it tries to create these other services on the IMAP server.

Note that IMAP is a standard which means every one that makes an IMAP server might have a different "standard"; remember "The nice thing about standards is that you have so many to choose from." --Andy Tanenbaum

Regarding GMail, personally I have a GMail account as my Apple ID and added iCloud email under that account. So when I set up my iCloud service it only sets up everything on iCloud. Then I setup GMail using the System Preferences, but turn off Notes (keeping Calendar & Reminders). If you leave Notes checked, it puts a "[IMAP]/Notes" LABEL in your GMail.


Restore from backup on iPod touch issues Here's the story:
I recently tried to update my iPod touch 4th Gen. to iOS 4.3. I did make a backup yesterday at 6:30PM, then I clicked update in iTunes. That's when everything went to hell.
The first update didn't work. There was an error (I don't remember the exact error) and the update failed. I could still use my iPod, but none of my apps would open. I tried the update again and, after some more trouble, it seemed to work. However this time I couldn't get to my music. It said "You must sync your iPod with iTunes first before you can use Music."

I tried this, but no matter how many times I synced, this problem would not go away. So I figured I would just restore it from my backup. This doesn't work. I keep getting this error: "Could not restore because the backup failed." It says this for every backup.
I've tried completely restoring the iPod to both 4.3 and 4.2 and nothing works.

It seems to me like there is a communication issue between the iPod and my (crappy) PC. When I click "restore from backup" this weird little window pops up in iTunes with an indefinite progress bar. Its title is "Restoring from backup" and under the progress bar it says "Estimating time remaining." The real interesting part is that the iPod is unaffected. It doesn't change to the "Restore in Progress" screen or "Sync in Progress" or anything.

I'm really at a loss here.

With iOS devices there are a lot of issues that can be happening between iTunes and the iPod. Backups can take a very long time depending on the amount of application data or the size of the camera roll at the time of the backup. Troubleshooting these issues go from very simple troubleshooting steps such as updating iTunes and restarting your computer all the way to the more advanced troubleshooting steps. If you are getting an error code, this can help you determine the exact issue, there is a really great article for troubleshooting the iPod on apples support site @ http://support.apple.com/kb/TS1275

Some steps that you can take to help isolate the issue would be trying a different USB cable (if you have one) or different USB port (should be USB 2.0), if you are connecting to USB through USB hub or extender try plugging it directly in to the computer, creating a test windows user account can also save a lot of headaches by letting you know it is something specific to that user account, and trying to sync music on another computer. I would try walking through that article and if your still having issues after that to try contacting apple or setting up an appointment at an apple store to make sure there is nothing wrong with the actual hardware of the iPod. Best of luck


Notification Centre in iOS7 I've seen pictures like this for iOS 7, where in notification centre you get driving instructions to locations, I don't have this, however I do have Frequent locations recorded (quite a few) as i've had iOS 7 on a 5S for about a week. But still no driving instructions to work! Any ideas?

It took about 3 weeks until driving instructions where shown on my iPhone's today screen. I guess it simply takes a while until it decides to have gathered enough information about your behaviour to show up specific driving information in your today screen.

For example in my case it shows me the time to work every monday to friday, but not on the weekends. So it had to record my behaviour for a few weeks until it knows that I don't drive to the office on the weekends.

So just wait a while and it will "fix" itself.


I removed my external drive icon on my macos, how do i put it back? As per title, I decided I wanted to remove my external drive icon (the one that is shown, usually, on the desktop) on my mac, but now I'm not able to put it back.

The problem is not due to the finder preferences, as external drive IS ticked.

I remember doing it from the terminal with a command, but now I'm not able to revert that change.

I did try with the following commands with no luck:

defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true

from this answer: How to show Hard Disk icon on Desktop via Terminal?

and I've also tried with this command:

defaults write com.apple.finder CreateDesktop -bool true; killall Finder

from here: http://www.idownloadblog.com/2016/02/01/how-to-hide-device-icons-on-your-mac-desktop/

But neither worked.

Any help with this? I just want the drive icon to be on the desktop when the drive is connected, nothing more

Thanks for any help

You can reset these settings to their default values by deleting their keys.

defaults delete com.apple.finder ShowHardDrivesOnDesktop
defaults delete com.apple.finder ShowRemovableMediaOnDesktop
defaults delete com.apple.finder CreateDesktop
killall Finder

Note that the CreateDesktop key is for determining whether any icons are on screen, so if you are able to put other files on the Desktop then the problem is not with the CreateDesktop key's value.


Why are some icons sideways on my desktop? On the current version of OS X Snow Leopard (10.6.8), I have an icon sideways on my desktop:

Any idea why or what it signifies?

It's not that the icon is sideways, it's that the small thumbnail for the file that's used as the icon needs to be wide because the CSV file has at least one really long line of data in it. The thumbnail you're seeing is a dynamic preview of the contents of the file and in the case of the file on the top of the image, the data contents demand a lot of horizontal space to show you the preview.

Here's an example: I've created two CSV files on my desktop. One file has ~500 columns of data on one row. The other has 10 columns of data on one row. The thumbnail for the 500 column file is wide because that's what previewing the data demands.

Pretty smart of OS X really.

Edit: Someone asked where the threshold for change was in the thumbnails. I did some quick experiments. I saw changes in the thumbnail dimensions at 61, 81, 101 and 121 characters of text on the one line. Note: that is characters, not columns of data. So it includes the data and the separating comma. Here is how the thumbnail icon evolved as the file contents changed:

For all of these snaps I just changed the length of the text on the one line in the file via TextMate and save the file, viewed my desktop and there was an updated thumbnail.


Why is my iTunes library in iCloud grayed out? I got a new MacBook Air. I registered with iCloud purchased iTunes Match and now my whole iTunes library (originally on my iMac) shows up in iTunes on the MacBook Air, but it's all grayed out and nothing will play. What haven't I done?

This is likely because iTunes Match is enabled on your MacBook Air under the same Apple ID your purchased it on and configured it for on your iMac. When you configure iTunes Match on a second machine, it puts the entire iCloud library in iTunes grayed out with the option to download. There should be a small download button in line with your songs that will allow you to download the matched songs:

Good luck.


How can I expand my remote desktop image size? I'm primarily a PC/*nix user and just have a MacBook Pro for the occasional iOS dev work.  Rather than clutter up my desk with multiple screens, keyboards, etc, I use my Windows box as my primary and do full screen remote connections to the other machines.  Works great for the various Windows and *nix boxes I need to access.  However, the Mac only allows me to connect (via VNC) at the resolution of the built-in screen.  The built-in screen is pretty low res compared to my large desktop monitor on the machine I'm connecting from.  Currently I can either work inside a small window, or stretch it to fit (making the pixels huge).  What I'd like to do is have a remote session at the full resolution of the machine I'm connecting from.  Any good solutions for this use case?

Mac OS doesn't have a terminal services centric design, so the loginwindow ties the remote screen resolution tightly to the actual physical screen dimensions.

Some easy solutions are to connect the Mac to a display (or a display dongle that simulates a plug and play monitor of a resolution of your choosing to the OS) so that the OS allocates a larger pixel boundary when the user logs in.

Alternatively, you could get software like SwitchResX to force the display to a size of your choosing.


Is it possible to wake a machine from ARD? Is it possible to wake a machine from ARD ? I have issues sometimes connecting to machines if they are in sleepmode and sometimes have to walk over to the machines and manually take them out of sleep mode before i can connect with ARD ?

Your network needs to be able to send WOL (wake-on-LAN) packets to the machines affected. If your network is subnetted, the problem becomes more difficult, if not impossible, without router config magic. This thread at Apple Communities explains the details more succinctly, and offers some solutions.

When I was managing 300+ Macs on two campuses more than a decade ago, it was impossible to wake any Macs from sleep reliably with ARD, so I set the Macs to spin down the hard drives when not in use and set the monitor sleep to a relatively short duration. The Macs never slept during the school day, and to save power, I used pmset commands to turn the Macs off after the close of the school day, and start up before school started on the morning. Naturally, people being who they are, some folks would power-down manually when they were done, but there was nothing I could do about it.

We now use JAMF JSS to manage our Mac fleet, which is thin on desktops -- laptops are the machine of choice. ARD has fallen by the wayside. I loved using it, but I'm no longer doing any serious Mac administration.


Switching to some apps in a different virtual display doesn't work I have OS X El Capitan (10.11.6) installed on my MacBook Pro 2015. I use Spotlight a lot to switch between apps in different virtual desktops and one day some months ago I noticed that it won't switch to the virtual desktop of the app I wanted to switch to. The same happens if I click on the icon in the dock.

Some apps that it doesn't switch to are Skype, FileZilla, IntelliJ Idea and more.

The setting System Preferences > Mission Control > "When switching to an application, switch to a Space with open windows for the application" must be enabled for OS X to automatically switch your desktop/Space when changing to an open program.

Otherwise, it will stay in the current space and one of a couple of things will happen, depending on the way the application is programmed:

The menu bar will change to that program's, but nothing else on the screen will change, or
A new window for that program will be opened (think a text editor opening a new, blank document), along with the menu bar changing


How can I delete "Passenger" from my "System Preference"? About 2 years ago I tried and installed Phusion Passenger Preference Pane for OS X and now I need to delete its "Passenger" icon from my System Preference. There's no uninstall option, how can I delete it?

I use Mac OS X 10.5.8

Just right click the icon and select remove. (it will be moved to trash which you can empty to get rid of it completely)


Cannot go fullscreen by dragging a app in mission control Steps I'm doing:

4 Fingers up to open Mission Control
Dragging any app to the top (e.g. Finder)
Nothing is happening it is not going full screen.

Did I do something wrong on settings and never noticed? I cycled through many boots it seems like a permanent thing.

How can I fix this?

This can be solved by enabling Displays have seperate spaces in System Preferences (Found under Mission Control). Then logout and log back in to apply the setting.


How to install newest Ruby version without Homebrew? I am using macOS Mojave. My work account has no administration privileges because of known macOS vulnerability. I have separate admin account. I have just tried to update Ruby to the newest version following documentation on https://www.ruby-lang.org. I have tried to install Homebrew manage Ruby upgrade but it wants my account to have admin privileges. Is there any other way to install Ruby?

@nohillside has reminded me in his comment:

  The recommended way is "switch to your admin account, install ruby, switch back".


iPad Air with foreign GSM carrier The new iPad Air Wi-Fi + Cellular model will work with one of these wireless carriers: AT&T, Sprint, T-Mobile, or Verizon. But, when I travel internationally, can I use a nano-SIM card from another local GSM carrier?

I won't be possible if your iPad is carrier locked.

If it isn't,  it will work.


How to take care of an iPod touch with a broken screen? I have a 4th gen iPod touch that recently managed to escape my hand and embrace the floor. While the situation was rather comical, now the glass screen is broken. Everything else works fine, including the touchscreen, but it has the so-called "Spiderman" cracks all over half the screen.

I've called Apple to see if they'll fix it, but it's too expensive, so I'm not going to do it. I also don't think I'd trust myself or an unofficial repair shop to do it. So my question is, what can I do to prevent further cracking? There are some places where it looks like pieces of glass could fall off easily. Is there any way to protect what's left of it while making sure the touch sensitivity still works on the whole screen?

Unless you are going to never flex the device, you'll want a clear adhesive cover or clear tape to prevent the glass from easily falling out and cutting your fingers or lying in wait in a pocket or bag.

Something like a Otterbox case with a more substantial plastic barrier might be appropriate (or even both clear tape and a thicker plastic sleeve depending on how likely the glass is to fall out.

If you run your finger nail lightly over the surface, you should be able to tell if the underlying layers are cracked or if the surface digitizer layer is cracked and proceed appropriately.

In cases where the digitizer is intact, I have known people to baby a phone for 6 or more months without any glass pieces falling out, so it really depends on how bad your drop was.


Explore contents of a ZIP/Archive from Finder? I've lost count how many times I've double-clicked a .ZIP file on Mac to look inside it (like Windows) only for it to auto-extract in the current location, which is rarely my preference.

Does MacOS provide a way for me to explore (and ideally edit) the content of archive files like Windows?

Previewing contents of zip files in the GUI is not available within macOS as it ships out.

You may however install a QuickLook generator to do that
One would be available within
https://macitbetter.com/BetterZip-Quick-Look-Generator/

The full app is 30-day trialware, but the QuickLook part will still be available after that period has elapsed.

To use it, slect a zip-file and hit Space.

Manipulating files within an archive is limited.

Specialised for this would be

  The Archive Browser (non-free)

  Quickly view archive contents

Of course, if you are serious about file management, you'd have to ditch the overly limited Finder.app and use professional software to that end.

One alternative worth looking into would be PathFinder:  unlike Finder the workflow "Get Info">"Preview" in PathFinder offers not just a big icon, but also a preview of what's inside.

Most closely resembling your previous experience in use, but not in setting it up, would of course be to combine https://osxfuse.github.io with https://bitbucket.org/agalanin/fuse-zip/downloads/

  use-zip is a FUSE file system to navigate, extract, create and modify ZIP and ZIP64 archives based on libzip implemented in C++.
  With fuse-zip you really can work with ZIP archives as real directories. Unlike KIO or Gnome VFS, it can be used in any application without modifications.

If a seamless usage is the goal but the manual setup sounds too complicated for that, then it's worth to take a look at ivoronin/ArchiveMounter:

  Mounts archives like disk images (macOS)

If you 'install' that application and drag its icon also to the Finder toolbar, (in macOS this was made slightly more complicated: hold Cmd and then drag the app to the toolbar until you see a plus sign) you have a convenient, low-cost solution, that allows you to look inside the archives, extract single files as needed and even manipulate the contents without a full decompression (and/or re-compression). Although that last feature seems to be judged as not that stable by the developer, as it's turned off by default: without setting any preferences it defaults to 'mount' archives read-only.

To solve the issue with double-click resulting in an undesired action (full decompression), you then have to choose from one of the options listed here your favourite method. Then right-click on a zip-file and choose "Get Info". Set your desired action accordingly under the heading "Open With".


Are there disadvantages to using different Apple IDs for iCloud and Store purchases? Apple provides instructions for configuring one Apple ID for iCloud and a different Apple ID for Store purchases. But this is clearly not the "recommended" approach.

Is there a reason to avoid doing this? Are there disadvantages, such as lost integration, or omitted features that result from using different IDs for iCloud and Store purchases?

As of right now, there are no disadvantages. In fact, my fiancée and I do this right now. We share an AppleID for store purchases and set up Home Sharing so that our iPads and MacBooks can share apps, but we have separate iClouds on our machines and everything works fine.


Your calendar couldn't be refreshed (Operation: CalDAVRefreshDelegateListQueueableOperation) After upgrading to the latest Mojave update [10.14.3[, I got this error prompt when attempting to sync my calendar.

Temporarily, I'm using Fantastical as my Calendar, But really prefer the Calendar.app over Fantastical.

Anyone got it too? How should I fix this?

Thanks in advance!

Sign out of iCloud

To fix this sign out of iCloud in the preferences pane. No data will be lost and all will be retrieved when you sign back in again. If you use iCloud Keychain, when you sign back in to iCloud follow one of the procedures described in this Support article to set it up on an additional device.

If that doesn't work

If signing out and in of iCloud doesn't work there are several other options you could try.

Re-enabling the calender account

You could try re-enabling the affected calender account. From the Calendar menu bar, select
Calendar ▹ Preferences ▹ Accounts.

Choose the affected account from the list on the left and uncheck the box marked. Then check it again to enable the account.

Add the account again with the same settings

You can make a note of the settings for that acxoint, then delete it and add it again with the same settings.

Check your settings

If you can't add the account, the settings may be invalid. Verify them. How you do that depends on what kind of account it is. If it's a Google calendar and you've activated 2-step verification, you need to generate an application-specific password in your Google account and enter it in place of your old password.


How can I protect headphone jack from heavy cable? So far I have ruined the headphone jack of one iPhone and one iPod with the the trauma from the frequent yanking of the heavy cable of my Sennheiser HD280 Pro headphones:

I think the damage mostly happens when I keep the iPhone or iPod in my pocket and walk around. Not only will my leg push the plug, but the heavy cord will also yank it slightly with every step. Because the plug is much larger than that of Apple's ear bugs, it becomes a larger lever, gradually loosening the jack.

Apart from getting lighter headphones, how can I prevent it from happening again? The best idea I have come up with is to use a six-inch extension cable with a right-angle plug; this should at least reduce the leverage.

Will this be sufficient to prevent damage? Does anyone have better ideas?

The short nub of the L shaped jack should work nicely to avoid a large lever sticking out of your headphone jack.

I actually prefer a different approach to this problem of leverage - a flexible and much shorter adapter that bends like a tree in the wind rather than breaking as a rigid lever must do.

The Monster iCablelink adapter is high quality and very inexpensive on the internet.

As you can see there are only the two stereo pins on this adapter so you will lose any microphone (and likely any button control) so you will want to select an adapter to pass those pins through if you need microphone functionality.


Is there are place to report missing/incorrect album art to the iTunes team? I know there are various ways to get/replace album art in iTunes and other questions about that. Some of them don't provide as good quality art as from iTunes (Store). Some of them also inflate file sizes by putting the image in each album. However, one thing I've noticed is that sometimes art gets updated in the store to better reflect the CD I ripped, or missing art becomes available. For example, Bob Dylan albums used to always get the ugly "Bob Dylan Collection" cover (same for each) whereas now they get the real original covers.

Is there somewhere to report mistakes and omissions to the team responsible? It seems that overall quality could easily be improved if Apple accepted "bugs" on this. The mistakes often seems quite strange - for example, the album is in the store with the correct artwork and yet you get the wrong art downloaded or none at all. I recently got correct art for an unusual independent artist who I thought had self-published his album, followed by nothing for Phil Selway's much more famous new album. This album is available (correct art) in the store!

you can always use Apple Feedback page to submit any kind of request.

if you have this problem in our own iTunes Library, it is easy to assign a new cover to the song or album by just dragging the cover to it or using the GetInfo option, you know how to do this right?

if you install Last.fm app you can simple play a song and then drag the last.fm cover into the artwork of the iTunes song.


Correlative numbers formula in Apple Numbers I have text in column B. But there are some columns that are empty. There is no rule the empty raws are at random. This is what I have now:

I want to have correlative numbers in column A. The problem is to detect the empty raws. That should be the result:

Enter a 1 in the cell A1.
Insert the following formula into cell A2.

IF(ISBLANK(B2),"",MAX(A$1:A1)+1)

This formula checks the cell to the right to see if it is blank. If it is blank, the cell in the A column should be blank too. If not, the cell should be filled with the next integer, which equates to the maximum integer reached so far + 1.
Fill the rest of the A column using this formula. Use the yellow fill handle so that the formula is adjusted correctly as it fills. The $ sign fixes the first cell of the range used by the MAX function.


Reopen all the windows after shutdown There was once a feature that reopened all the windows on startup. Is it possible to enable that somehow, even the checkbox "Reopen all windows ..." disappeared.

Did this happen because of an update ? I it possible to revert back to an older version ?

Mac OS version 10.6.8

The Feature is still there.

I do not have 10.6.8 (I have the 10.8.4) and it shows this.

If you do not see it, but had it before then check the
Library/Saved Application State folder to see what files are in it.

I would suggest to run the cmd and R and run the repairs from there.


Using public key with OSXFUSE I have been allotted a system-generated password (which is impossible to remember) that I cannot change and every time I mount a folder from the remote machine, I have to enter the password for that account.

I have set-up a public key based log-in which works fine when I use ssh. That is, I do not have to enter the password when I am using ssh.

However, when I use OSXFUSE to mount a folder, I am asked for the password every time. How do I make OSXFUSE to use the public key for mounting the folder?

Command that I use to mount the folder:

sudo sshfs -o allow_other,defer_permissions root@xxx.xxx.xxx.xxx:/ /mnt/droplet

After trying some suggestions from https://github.com/osxfuse/osxfuse/issues/341 (An open issue for OSXFUSE), the following command worked for me -

ssh-add -K ~/.ssh/id_rsa

Use of option -K:

 -K      When adding identities, each passphrase will also be stored in the user's keychain.  When
         removing identities with -d, each passphrase will be removed from it.


Parallels - Can I have a keyboard shortcut for the context-menu key found on Wintel hardware? On a lot of Windows keyboards there's a key to the right of the spacebar that brings up the context-menu (right-click menu) in applications (I'm running Win7). I can't seem to find a way to map this function to the VM's keyboard in Parallels. Is it even possible?

For Bootcamp I'm using AutoHotkey app as a way to remap standard Windows keyboard switch combination to Command ⌘+Space.

I've just tried to remap right command key of my Apple Aluminum keyboard to become Context menu key and it works with editing AutoHotkey.aht configuration file  and adding

  RWin::AppsKey

as a key binding. You may read more on remapping with AutoHotKey here. And here is a list of key names.

Also, in Windows, Shift ⇧+F10 should act as a context menu shortcut but I can't attest since my F10 key is not working and I'm too lazy to boot into Windows again and remap it just to test it.)


How to commit a file with TortoiseHg? I have installed TortoiseHg on my Mac. I can run it, and it opens the repository browser. However, unlike on Windows, it doesn't add new items to Finder context menu. So I cannot right-click a file or a folder and do 'commit'. How can I perform commit then, without going to Terminal level?

To do this, you would need to do basically two things:

Create an Automator Service that commits the job
Add the Service to the context menu

Both of these topics has been answered here on Ask Different; I linked to two excellent examples.

What you would have to do is create an Applescript or a bash script (bash probably being easier) that "commits" whatever it is you want to commit - you will have to scope the requirements in detail.   Once you have the script written, add it to the context menu.


How do you insert literal control chars in vim on Mac? How do you insert literal control characters in vi on Mac?

For example what is the Mac equivalent of

Unix ^V^M
Windows ^Q^M (in vim)

to insert a \r into a substitution string?

It's the same like in Unix/Linux:

^V^M

But, if you want to use the character in a substitution string, then you should write it like it is, \r, e.g.

:%s/blabla/\r/


Applescript Validating USB Stick - Matching serial and mount point I want to be sure that the USB stick at 'usbMountPoint' is also the one with the matching 'usbSerialNumber'

-- Get Mount Point of script's USB host
tell application "Finder"
   try
       set usbMountPoint to text 1 thru -2 of POSIX path of (disk of (path to me) as alias)
       log usbMountPoint --> Output: /Volumes/usb-drive-name
   on error
       set usbMountPoint to POSIX path of (disk of (path to me) as alias) --> if file is on desktop, path: '/', can't have ' ' hence no removing
       log usbMountPoint --> Output: /Volumes/usb-drive-name
   end try
end tell

-- Set Serial Num of USB Stick
set usbSerialNumber to "C86000BDB9F2BFA04A31E8A1"

-- Check if usbMountPoint and usbSerialNumber exist
set sysProfileUSB to (do shell script "system_profiler SPUSBDataType") as text
if sysProfileUSB contains "Serial Number: " & usbSerialNumber and sysProfileUSB contains "Mount Point: " & usbMountPoint then
   log "USB Stick Found!"
else
   log "USB Stick Not found."
end if

When validating to check if usbMountPoint and usbSerialNumber exist in system_profiler, the code should check if the USB device at 'usbMountPoint' has the serial number of 'usbSerialNumber'.
Without this "matching/pairing", the user could simply have two USBs connected - one with the right serial number, the other with the script; while the code will return "Found" becuase 'contains' reads the entire system_profiler without validating that both variables come from the same device.

Any help would be greatly appreciated. Cheers.

Of course I do not know the total scope of what you're trying to accomplish however because as you presently have it coded, the script could be running from other then the target USB Drive. So I've written it a bit differently, however it does get the mount point based on the serial number if the target USB Drive is mounted. You can then branch accordingly to the conditions, i.e. whether the script is running from the target USB Drive or not and if the target USB Drive is mounted or not, etc. After getting the mount point in the code, I've included another block of code to test against if the target USB Drive is mounted and where the script was run from. This obviously is just one example of testing and you'll have to do as you need. The bottom line here is, how I coded getting the mount point of the target USB Drive based on the serial number and this I guess it what you're really looking for.

Here's my take on the code and it's output when run from both the Desktop and the target USB Drive:

Note: Before use, change the actual serial number below to the appropriate value.

AppleScript Code:

--    # Get the volume this script is located on.

tell application "Finder"
    try
        set theVolumeThisScriptIsLocatedOn to text 1 thru -2 of POSIX path of (disk of (path to me) as alias)
        log "The volume this script is located on is: " & quoted form of theVolumeThisScriptIsLocatedOn
    on error
        set theVolumeThisScriptIsLocatedOn to POSIX path of (disk of (path to me) as alias)
        log "The volume this script is located on is: " & quoted form of theVolumeThisScriptIsLocatedOn
    end try
end tell

--    # Set the Serial Number of the target USB Drive.

set usbSerialNumber to "200434112111BA425FA4"

--    # See if the USB Drive matching 'usbSerialNumber' is mounted and if so, get its mount point.
--    # The variable 'usbMountPoint' will contain either its mount point, e.g., '/Volumes/...', or '' as in nothing.

set usbMountPoint to (do shell script "system_profiler SPUSBDataType | awk '/" & usbSerialNumber & "/' RS= | awk -F': ' '/Mount Point: /{print $2}'") as text
log "The mount point is: " & quoted form of usbMountPoint
if usbMountPoint is equal to "" then
    log "The target USB Drive is not mounted!"
else
    log "The target USB Drive is mounted!"
end if

--    # See if the script is running from the target USB Drive or elsewhere.

if usbMountPoint is not equal to "" and theVolumeThisScriptIsLocatedOn is equal to usbMountPoint then
    log "This script is running from the target USB Drive!"
else
    log "This script is not running from the target USB Drive!"
end if

Replies when run from the target USB Drive:

tell current application
    path to current application
        --> alias "16GB-USB:USB Test.scpt"
end tell
tell application "Finder"
    get disk of alias "16GB-USB:USB Test.scpt"
        --> alias "16GB-USB:"
    (*The volume this script is located on is: '/Volumes/16GB-USB'*)
end tell
tell current application
    do shell script "system_profiler SPUSBDataType | awk '/200434112111BA425FA4/' RS= | awk -F': ' '/Mount Point: /{print $2}'"
        --> "/Volumes/16GB-USB"
    (*The mount point is: '/Volumes/16GB-USB'*)
    (*The target USB Drive is mounted!*)
    (*This script is running from the target USB Drive!*)
end tell

Replies when run from the Desktop with the target USB Drive connected:

tell current application
    path to current application
        --> alias "Macintosh HD:Users:me:Desktop:USB Test.scpt"
end tell
tell application "Finder"
    get disk of alias "Macintosh HD:Users:me:Desktop:USB Test.scpt"
        --> alias "Macintosh HD:"
end tell
tell current application
    path to current application
        --> alias "Macintosh HD:Users:me:Desktop:USB Test.scpt"
end tell
tell application "Finder"
    get disk of alias "Macintosh HD:Users:me:Desktop:USB Test.scpt"
        --> alias "Macintosh HD:"
    (*The volume this script is located on is: '/'*)
end tell
tell current application
    do shell script "system_profiler SPUSBDataType | awk '/200434112111BA425FA4/' RS= | awk -F': ' '/Mount Point: /{print $2}'"
        --> "/Volumes/16GB-USB"
    (*The mount point is: '/Volumes/16GB-USB'*)
    (*The target USB Drive is mounted!*)
    (*This script is not running from the target USB Drive!*)
end tell

Replies when run from the Desktop without the target USB Drive connected:

tell application "Finder"
    get disk of alias "Macintosh HD:Users:me:Desktop:USB Test.scpt"
        --> alias "Macintosh HD:"
end tell
tell current application
    path to current application
        --> alias "Macintosh HD:Users:me:Desktop:USB Test.scpt"
end tell
tell application "Finder"
    get disk of alias "Macintosh HD:Users:me:Desktop:USB Test.scpt"
        --> alias "Macintosh HD:"
    (*The volume this script is located on is: '/'*)
end tell
tell current application
    do shell script "system_profiler SPUSBDataType | awk '/200434112111BA425FA4/' RS= | awk -F': ' '/Mount Point: /{print $2}'"
        --> ""
    (*The mount point is: ''*)
    (*The target USB Drive is not mounted!*)
    (*This script is not running from the target USB Drive!*)
end tell

Understanding what the set usbMountPoint to (do shell script "...") as text command line is doing to set the value of the usbMountPoint variable.

system_profiler SPUSBDataType | outputs all information related to the USB hardware and then gets piped to the first occurrence of awk in the command line.
awk '/" & usbSerialNumber & "/' RS= | looks for the serial number and outputs everything from the first blank line before the serial number and the first blank line after the serial number and its output then gets piped to the second occurrence of awk in the command line. This ensures the only line containing '/Mount Point:' in the output is associated with the serial number (if the target USB Drive is mounted).
awk -F': ' '/Mount Point: /{print $2}' finds the line containing 'Mount Point: ' then uses ': ' as the field separator and prints the second field which will either be the POSIX pathname of the mount point of the target USB Drive, or '' as in nothing (because it wasn't mounted).


Can we install Windows on a Mac mini Can we install windows on Mac mini?

Also, is it possible to  Install Mac OS on PC's rather than Macs ?

Yes, Apple provides a Software (including the drivers) to install Windows a Macs: Bootcamp

Apple's EULA doesn't allow installing OS X on non Apple hardware. Although, some people have already done this (they call this Hackintosh) but it's tricky and you'll never have a fully functioning system (there are always bugs somewhere).


Watch a video while it downloads in iTunes 10 Previously when downloading an iTunes U video I could double click it and the video would start playing while it is downloading. But now after updating to iTunes 10 it doesn't seem I can do that? Is it just me or have Apple gone backwards on this.

As of iTunes 12, you cannot watch a movie while it is downloading. This is a pretty recent change, but has been proven and is 100% reproducible. You have to wait for the movie or TV show to finish downloading. (Trying to play before it finishes downloading shows a black screen, until download is finished -- then play begins as usual). This is a real shame and makes no sense, given that an Apple TV can actually play while streaming... but, guess that's different software. (Netflix for the win!)


Why are jpeg & pdf documents being covered with solid black rectangles? There are specific pages of legal documents that I scanned myself as jpegs then combined in a pdf yesterday and they looked great. I downloaded it back from iCloud and they show up in the application for maybe 0 to 1 frames before a black rectangle covers up all the information in the document. Then I opened some jpegs that have been only on my computer since scanned, and they get the same censoring effect. I think I'll make up the term dynamically redacted since the redacting is being done by the application when displaying the otherwise non-redacted file. For further evidence as requested by a commenter, I also moved the file that Preview was redacting into iCloud to test it with my iPhone and was able to view the file normally with the iPhone.

Here is the problem occurring in Preview with a local pdf document.

Here is the problem occurring in Finder with local jpeg files.

Here is an example depicting more concretely a comparison that the documents are being observed sometimes normally and sometimes they are censored. When I attempted to take this final image with grab it refused when I selected Preview as a window and said that "the contents cannot be shared."

So far, I've noticed that the censoring affects Preview and Finder so it must be an Apple system-wide protocol. Grab probably is just inheriting the message from the window that it tries to grab from.

Update
It may be interesting to point out that the pages that are redacted are exactly the ones which I scanned using the document feeder and not the ones using the flatbed of the scanner. So, it could be possible that the scanner is somehow setting a setting for the pdf files based on how they are scanned. The scanner was a Brother MFC-7460DN

Update 2
It appears as though I found the culprit setting. Notice that the infos with color show the preview image while the ones set to grey do not. This fact applies to the other examples as well. Apparently, it is simply how the applications handle previewing greyscale images vs. color.

It is a result of how Apple implemented the display for Preview and Finder which depends on whether the jpeg or pdf has the property of being a color image or greyscale image.


Disabling / Uninstalling iTunes on macOS Mojave I'm using MacOS 10.14 Mojave on a MacBook Pro.

I'm trying to disable iTunes, mostly because it annoys me several times a day when I use my keyboard play/pause media button.

I have Spotify up and running and it usually gets these commands, but sometimes iTunes will pop out of nowhere (mostly when it's been a while without focusing the Spotify window).

I know in the past iTunesHelper process was responsible for this behavior and we could just disable it in the login items.

But today I have nothing in my login items, and no iTunesHelper process running.

The only suspect process I found was "com.apple.iTunesLibraryService", I tried to force kill it but it won't change anything.

Of course I tried to delete iTunes but it is "required by MacOS" -- seriously.

If I try to change authorisation on app to force uninstall anyway it tells me I don't have the required authorizations to do that -- as an administrator, right.

The only way to delete it seems to imply using some shady tricks that may or may not break my OS.

I'm seriously annoyed by the fact I can't own my laptop fully.

How can I uninstall or disable iTunes on macOS?

Side note: I will never connect any Apple device to my laptop, if that matters for iTunes sync or something.

Disable SIP
Open /Applications/Utilities/Terminal.app
Enter in sudo rm -rf /Applications/iTunes.app
Enter your password (it won’t be displayed on screen)


Isn't it redundant to have Versions as well as Time Machine? Versions and Time Machine seem to me to offer duplicated features: both do hourly backups, and their interfaces for browsing previous versions of files are very similar.  The only difference I can see is that Time Machine backs up all files regardless of whether their associated applications support the TM interface, so even if the app I use to view the file doesn't work in TM, I still have backups of my files - whereas Versions has to be supported directly by each application.

I can understand having Versions' file and document versioning support there under the hood in order to enable multiple applications to open a single file without causing corruption - but why present this versioning system to the user when we already have Time Machine with the same features and a near-identical user interface?  Why use more disk space to provide the same feature twice?

Is there a crucial feature or use case for either Versions or Time Machine which means it makes sense to have both?

No it is not the same:

Versions: It is for different versions of your documents. You change something in your document and you can revert to an earlier version. This is not possible with Time Machine in this granularity.

Time Machine: It is for backup. It handle the case that you need to recover from a hard disk crash in your mac. You can't do that with versions since versions saves your changes on the then defect hard disk.

So they have their purpose since they „solve“ different problems.


Install MacOs Mojave (Only Bootcamp partition) I was given a Mac Book Pro (Retina) with BootCamp and then realized it was the only partition, so I don't have a MacOs in my Mac machine!!!
Considering that, what's the easiest way to install a MacOs?

This link has a good starting point. First up, you obviously need to create a mac partition on the computer. Next, you will need to find a copy of macOs (obtainable via Mac App Store by all mac users, hence you only need to find a mac owner willing to give you a copy) and convert it into a bootable USB drive. Next, you have to boot into the mac partition on your computer and install macOS via the bootable drive.


What is the difference between a "sparse disk image" and a "sparse bundle disk image"? What are the differences between sparse and sparse bundle disk images?

From the DropDMG manual:

  Sparse
  bundle disk images appear as a single
  file but are actually stored as a
  folder with many files inside. This
  makes it more efficient to back them
  up using Time Machine or other backup
  utilities, as only the changed parts
  need to be copied. Additionally,
  sparse bundle disk images work well
  with the Compact Image… command.
  Compatible with Mac OS X 10.5 and
  later.

  Sparse
  disk images are stored as a single
  file. This can make backups
  inefficient for large disk images,
  because the entire file must be copied
  each time. The Compact Image… command
  generally does not reclaim as much
  disk space as with sparse bundle disk
  images. Compatible with Mac OS X 10.3
  and later.


How to recover this damaged CoreStorage PV records? I have played something following https://www.reddit.com/r/osx/comments/2wzlxc/a_corestorage_primer_aka_why_you_cant_manipulate/ ,like:

hdiutil attach -nomount ram://$[2048*1024]
diskutil cs removeDisk

After reboot, one of the PV record is missing:

$ diskutil cs list
CoreStorage logical volume groups (1 found)
|
+-- Logical Volume Group 55723AF5-6C77-4010-848D-95AD20D74899
    =========================================================
    Name:         FusionDrive
    Status:       Offline
    Size:         1644054888448 B (1.6 TB)
    Free Space:   -none-
    |
    +-< Physical Volume E4E1EDD1-E102-49C4-89A2-604BF05A7025
    |   ----------------------------------------------------
    |   (No properties)
    |
    +-< Physical Volume 41771492-81C3-4F80-8B5A-EBF21613DB29
        ----------------------------------------------------
        Index:    1
        Disk:     disk1s2
        Status:   Checking
        Size:     1644054888448 B (1.6 TB)

I believe the missing one is disk0s4, but

$ diskutil cs info disk0s4
disk0s4 is not a CoreStorage disk

$ diskutil list
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *251.0 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                  Apple_HFS Macintosh HD            160.0 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
   4:                  Apple_HFS                         41.6 GB    disk0s4
/dev/disk1
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *2.0 TB     disk1
   1:                        EFI EFI                     209.7 MB   disk1s1
   2:          Apple_CoreStorage                         1.6 TB     disk1s2
   3:                 Apple_Boot Boot OS X               134.2 MB   disk1s3
   4:       Microsoft Basic Data BOOTCAMP                356.0 GB   disk1s4

How can I re-create a Core Storage record to let disk0s4 become a Physical Volume (PV) with UUID=E4E1EDD1-E102-49C4-89A2-604BF05A7025 ?

PV UUID is stored in the beginning of that volume.

Thus, this is a GPT Type error.

Use cgdisk to modify Type from af00 to af05, done.


Cleaning ‘staining’ off bottom of MacBook screen A couple months ago, I started to see some very small stain spots on the bottom of my MacBook Pro early 2015 screen. It's very annoying to see while I'm using it. When the screen is turned off, I see it as in the picture below. But when it's turned on, I see it as very small water-ish drops.
I tried to clean it using water, screen cleaner, and even alcohol, but it didn't go away.

Also that area doesn't feel as smooth as the unaffected area. So, I think it's on the outside of my screen not inside.

Have you ever seen this before? Any suggestions on how to remove it without the need of replacing the whole screen?

I've encountered something similar before and from the looks of it, the glass/plastic coating is etched.

A user once tried to clean their screen with acetone (nail polish remover) and it physically damaged the glass coating.  In the pre-Retina days, the glass was replaceable so it wasn't a costly fix.

Unfortunately, for the 2015 models, the glass and LCD are glued together so you will need to replace the entire assembly.

IFixit.com has an excellent guide on replacing the display assembly.  It's not difficult, per se, it's time consuming and you must exercise a good bit of diligence (it's not something you going to speed through) when disconnecting the components as they can be damaged.  If this is not your cup of tea, have a pro do it for you.  Read the guide anyway, this way you know what to expect of the tech that does the work.


How to toggle between "Portrait" and "Landscape Right" orientation in iOS simulators via AppleScript? How do I toggle between "Portrait" and "Landscape Right" orientation in the iOS simulators via AppleScript?

On my system, using Script Editor, the following example AppleScript code works for me to toggle between Portrait and Landscape Right of the Simulator window:
tell application "Simulator" to activate

tell application "System Events" to ¬
    tell application process "Simulator" to ¬
        tell menu 1 of ¬
            menu item "Orientation" of ¬
            menu 1 of ¬
            menu bar item "Device" of ¬
            menu bar 1
            if value of ¬
                attribute "AXMenuItemMarkChar" of ¬
                menu item "Portrait" is "✓" then
                click menu item "Landscape Right"
            else if value of ¬
                attribute "AXMenuItemMarkChar" of ¬
                menu item "Landscape Right" is "✓" then
                click menu item "Portrait"
            end if
        end tell

Note: The example AppleScript code is just that and sans any included error handling does not contain any additional error handling as may be appropriate. The onus is upon the user to add any error handling as may be appropriate, needed or wanted. Have a look at the try statement and error statement in the AppleScript Language Guide. See also, Working with Errors. Additionally, the use of the delay command may be necessary between events where appropriate, e.g. delay 0.5, with the value of the delay set appropriately.


Share internet between iPad and PC I've been searching for this for a while without satisfactory results.

One way to share internet from the PC to the iPad is by doing an ad-hoc network, if the PC allow us to do so. Otherwise, I have two questions:

If the PC is connected to internet, How can we share internet from the PC to the iPad via USB?
Suppose the iPad is connected to internet by means of some wireless network, How can we share internet from the iPad to the PC via USB?

I have an iPad Version: 5.1.1 (9B206), Model: MB292LL (the first ones).

Alternatively, if the iPad is connected to some wireless network, is it possible make it an access point, so it extends the range of the network?

AFAIK iDevices MUST use Wifi for internet accesss. So No USB.

iDevices can provide an internet connection only when Personal Hotspot is enabled (So it's only for Cellular iDevices). In this only case you can use USB for internet connection.


Banish "You have forced XXX to quit" from showing on my screen again I never want to see this popup on my computer again.

Is it possible to prevent "do not ask again" this type of dialog?

Run the following, then log out and back in

defaults write com.apple.CrashReporter DialogType none


Add login item from command line Found the following Can Login Items be added via the command line in High Sierra?

which I'm trying to adapt to add a login item in 10.14.6

I realize that it's a somewhat old thread by now, but I've been trying with the following, in 10.14.6, adapted from the solved in thread linked above:

osascript -e 'tell application "System Events" to make login item at end with properties {path:"/Applications/cDock.app/Contents/Resources/cDock\ Helper.app", hidden:false}'

But keep getting the following error:

syntax error: Expected “"” but found unknown token. (-2741)

Can someone perhaps suggest how to rewrite this to avoid the error?

You need to remove the backslash (\) from: cDock\ Helper.app

You do not need to escape spaces in a path filename when it is in quotes.

Only escape spaces in a path filename when it is not in quotes.

Never do both, (in this use case).


How do I make passphrase prompts for ssh keys appear in the terminal, not as a graphical prompt? I'm SSHing into my mac and doing some stuff remotely through tmux (namely uploading some stuff to github). When I just tried to run a git push, my command kept stalling silently. I found ssh stalling on this message, debug1: key_parse_private_pem: PEM_read_PrivateKey failed, and divined that the password prompt was being caught by the Keychain app and being displayed on the screen. I was able to get it to go through by using teamviewer to enter my password on-screen.

But how do I keep these private key prompts from going to the screen in the future? I'm fine with being prompted for my passphrase, but I would like it to happen in a terminal window in the future.

the password for your key is managed by ssh-agent and it defaults to ask for your password using the GUI you mentioned. You could:

Unlock your key using the shell frontend to ssh-agent by calling ssh-add. In this case you might want to lock your key with ssh-add -D before you log out of the box.
Circumvent ssh-agent by temporarily unsetting the SSH_AUTH_SOCK variable ssh uses to connect to the agent. You can do this for a single command like this

SSH_AUTH_SOCK="" git push

or for the whole shell session by calling unset SSH_AUTH_SOCK.

Marcel


Will connecting an Exchange account to my Mac enable remote wipe? I know that connecting an Exchange account to an iPhone can give the Exchange administrators the ability to force a Passcode change or remotely wipe the device, but is this possible on a Macbook/OS X/macOS client?

The only supported devices for remote wipe are: Android, iOS, Windows. macOS is not supported.

https://docs.microsoft.com/en-us/intune-classic/deploy-use/use-remote-wipe-to-help-protect-data-using-microsoft-intune

inTune features for macOS are listed here:
https://docs.microsoft.com/en-au/intune-user-help/using-your-ios-or-macos-device-with-intune


Can I transfer iTunes purchases to new iTunes account My wife has had her iTunes connected with her parents and sister's account since middle school.  She hasn't ever synced her iPhone 4 with iTunes in that time, but she wanted to upgrade to iOS 5 to be able to upgrade some apps (pinterest, I think).  We created a new iTunes account, and obviously now I can't sync her old songs and apps.  Does anyone have any suggestions on how to get all of these songs again?  She has thousands, so it is not feasible to burn them all to CD then rip them all again (in addition to the quality degradation), and I can't buy them all again.

Thanks,

Tim

It's obvious Apple has a build in procedure to block this kind of actions. Otherwise they would go bankrupt... (Haha :))

However there are some work-arounds:

eHow.com has dedicated a tutorial concerning this issue. I haven't tested it, but the intro states it will do what you've asked
another way to do so is to just use both account on your iTunes, iPhone, iPad,... I do it with my iPad as well (both US and Belgium account) and yes it's a hassle, but it does the trick. I can access the apps, music and more from both accounts.


How to change "Nov 9 03:21:11" to yymmdd mmhhss using AppleScript/Unix? How to change string "Nov 9 03:21:11" to yymmdd mmhhss in AppleScript?

I don't have a mac to test with, but the OSX date man page suggests:

old="Nov 9 03:21:11"
new=$( date -j -f "%b %e %T" "$old" "+%Y%m%d %H%M%S" )
echo "$new"

I stongly recommend using 4-digit years. Have we learned nothing from Y2K?


MacBook Pro 2020 Fan Issues I recently purchased a MacBook Pro 2020 13" (1.4 GHz, 8GB Ram, i5). For some reason, when I open Chrome and watch Twitch my computers fans turn on and go crazy. After opening Activity Monitor, I noticed that Google Chrome Helper (Renderer) uses around 50-80% of my CPU.
Also, sometimes when I run code on my MacBook Pro, the fans turn on when the program is compiling/running but slow down a few minutes after terminating the program. Also, when watching Twice on Safari, the fans don't come on. However, around 50-60% of the CPU is still being used.
Should I be concerned about the CPU usage (I am nervous because I only recently purchased the laptop)?

Should I be concerned about the CPU usage (I am nervous because I only recently purchased the laptop)? I am nervous because I only recently purchased the laptop)

Nervous?  No.
From a hardware (damage) perspective, your Mac and the CPU itself is designed to protect itself from overheating.  It will kick in the fans, then throttle things back and finally, if it must, it will shut itself off.  Your risk of doing damage to your machine is virtually nil.
From a software perspective, I wouldn't worry either.  It sounds like your Mac is doing what it's supposed to do which is turn on the fans during high intensity CPU activity (compiling code) or watching video (GPU).  That said, I would probably look at something else besides Chrome as it's a known resource hog and not very "kind" to memory or CPU utilization.
It's also important to remember that the 13" MacBook Pro doesn't have a discrete GPU so it's the CPU that's going to be doing all of the graphic rendering and it will use up to 1.5GB of RAM as video memory (Intel Integrated Graphics Chipset).  So, if you're compiling code and watching HD or 4K videos simultaneously, you could be maxing out your hardware.
So, it is possible you undersized your Mac for your needs, so from a value perspective, I would defiantly look at that.  If you're still within your return period, it's something you should make a priority to evaluate.


Zooming in Quicktime Screen Capture Doesn't Show I'm trying to record a screen capture with Quicktime, but whenever I zoom in, it doesn't translate to the video taken. I've seen videos with screen zooming in them, so I know it can be done. I repeat, I can see the zooming while recording, but it doesn't show up in the video later on.

Thanks for any help.

Snapz Pro from Ambrosia is able to record the screen with zooming in and out. It costs $69 and can be found at: http://www.ambrosiasw.com/utilities/snapzprox/.

I tested and found this works with the most recent version 2.3.3.

Edit: Fixed punctuation.