1

I'm trying to add new stocks to my stock widget but it won't let me do so. It validates the symbol and then does nothing. I have to remove a current stock and then only will it let me add a new one.

Is there a max number of stocks I can watch on the list? I only have 20ish stocks right now.

I tried to add/remove the widget and that did not work.

  • test would be to remove 2, then add 3. If it stops after 2, you found the hard limit. – Tetsujin Apr 30 '15 at 18:39
  • It looks like fidelity market monitor widget allows 25 entries, so it would give you an additional 5 entries. – jimrice May 3 '15 at 0:33
4

You can find the default Dashboard widgets in /Library/Widgets. They are written using JavaScript, so it's pretty easy to access the code. For example if you right-click on the Stocks widget and choose "Show Package Contents" you will find a file called "Stocks.js" inside the bundle that contains the logic behind the widget.

On line 1319 of that file there is a function called "addOrSelectItem".

Aside from defining variables, the first thing that function does is check to see whether you are trying to add an existing stock (line 1321), if you are then it just selects the existing stock in the UI. However if you are adding a new stock the next thing it does is check if there are less than 20 stocks (line 1323), if there are less than 20 then it adds the new one. If there are already 20 stocks then it does nothing.

Simplified code below. The comments are Apple's comments. Clearly having more than 20 stocks is not "correct". :)

function addOrSelectItem () {
    var index = symbolAlreadyInSet(lastValidEntry.symbol);
    if (index < 0) {
        // make sure we have the correct number of items
        if (allTheData.length < 20) {
            ...
        }
    } else {
        // select the item that is already there.
        ...
    }
}

In theory someone could make a copy of that Stocks.wdgt file, open it up, change that single line in a text editor to allow more than 20 stocks and save it. Obviously distributing that modified version would be a bad thing, but modifying a copy for your own personal use shouldn't be a problem.

If you do create your own version you might need to kill the Dashboard process for it to notice the changes. Just select it in Activity Monitor and Quit it, it'll automatically relaunch.

Demonstrating Stocks widget with more than 20 stocks

0

The stocks widget for OS X is limited to 20 stocks.

This is from my experience and testing. I'm an app developer on all Apple platforms, iOS and OSX.

I have several macs running different versions and all hit the 20 mark and stop. I have tried many combinations and have not passed 20.

  • Unfortunately this is from testing. I'm an app developer on all Apple platforms, iOS and OSX. I have several macs running different versions and all hit the 20 mark and stop. I have tried many combinations and have not passed 20. If I come across any documentation I will pass along but have had the same issue myself. – jimrice May 3 '15 at 0:26
  • no problem, lets use your experience :) – Ruskes May 3 '15 at 1:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .