workflow no longer working

I had a workflow created by a very kind guy on here, and installed it, and it worked fine for about 5 days, but has now stopped working, and I can't find why.


Normally when you run it, you see the EDIT meny highlight before it enters the data, but this isn't happening now.


The workflow gets the date from the system, copies it to clipboard, and then pastes it into numbers. Below is the code.


I've still got it installed on my home macbook air, and it is still working there.


It's still installed on the work mac, but it doesn't run or work properly.


Can anyone help?


set the clipboard to (do shell script "date +%H:%M")

tell application "Numbers"

activate

tell application "System Events"

keystroke "v" using {shift down, option down, command down}

end tell

end tell



The workflow still exists in the automator, and it still has a shortcut attached as originally set, which is command-alt-'


I've noticed when I've tried to change the shortcut, that it often stops it working, and has to be reinstalled from scratch.


Also, the first time I ran it, it showed up in "numbers" in the automator under "app shortcuts" but it no longer does.

MacBook Air, OS X Mavericks (10.9)

Posted on Jun 6, 2014 2:43 AM

Reply
13 replies

Jun 7, 2014 7:41 AM in response to addybails

Hi Adam,


Sorry to leave you hanging. I've been away.


The Edit menu should flash, because the script is in effect "typing" Edit > Paste and Match Style.


Some ideas:


1) Make sure you do not have two versions of Numbers open at the same time. That will confuse AppleScript.


2) If you haven't done so already, try restarting your computer.


3) In Finder hold down the option key and Go > Library > Services and delete the service. Then download it again and double-click to install (if necessary clicking 'Open Anyway' in System Preferences > Security & Privacy.)


(Also, I think you said you haven't installed anything new. But if you happen to have a previously installed clipboard enhancement utility on your machine then that could also cause unexpected results.)


SG

Jun 7, 2014 8:49 AM in response to SGIII

Hi,


thanks again. I've tried all of that. I've deleted all of the new ones, rebooted, installed it all over again, and it still doesn't work.


Oddly, when I put it back in, it seems to know the shortcut that was assigned to it.


Again, when you run it, it highlights NUMBERS but not EDIT


We only have one version of Numbers on the system, and I've even tried it with only one sheet open, but still no luck.


Adam.

Jun 7, 2014 11:45 AM in response to SGIII

I didn't know about that menu item until reading this, but on trying it, no it doesn't work there either.


The shortcut I set up is cmd-alt-' which isn't a standard one. I've also restored all the default shortcuts and that doesn't change a thing, except it loses this one, and I have to reset it.


I had to experiment with about 6 different ones until I got one that worked. But since setting it up, we haven't set up any other shortcuts at all.


This shortcut worked for about a week, and then just stopped one day.


I've even tried other silly shortcuts that couldn't possibly be in use by anything else, and they don't work either.


But what concerns me more is that it hightlights NUMBERS when executed, which is the 'activate' portion of the script, but doesn't then do the paste.


If I run the shortcut, and then do the paste manually, we get a funny icon in the cell, which I think (not sure) looks like an apple script icon, rather than the value.


Adam.

Jun 7, 2014 2:11 PM in response to addybails

Adam,


Sorry to hear you are still having trouble. I deleted my original service and reinstalled from the link upthread. It works as expected here. I cannot reproduce your problem.


The only thing I can think of at this point is to try uninstalling Numbers and reinstalling. To do that, go to Lauchpad, hold down the option key until the icons shake, and click the x by the Numbers icon with the four columns. Then redownload Numbers from the Mac App Store.


SG

Jun 7, 2014 3:58 PM in response to SGIII

OK,


I've deleted and reinstalled Numbers, with no success. Oddly enough it charged me for it again. Dunno why, cos I'd bought it before under the same apple ID. Hey ho.


The other thing I've noticed now is that when you run the script, and it highlights NUMBERS in the menu, if you then manually select EDIT from the menu, the paste command is greyed out, as if there's nothing to paste.


So it looks like it's not getting the date info any longer, then activating Numbers, then not pasting because there's nothing to paste.


Any help?


Adam.

Jun 7, 2014 4:25 PM in response to addybails

Adam,


Numbers 3 should be free if you had it on your machine before (you were using Numbers 3 before, right?). In App Store you might try clicking 'Account' under Quick Links and Reset all warnings for buying and downloading. And, if necessary, also contact Apple to get that charge reversed.


I can't reproduce the script problem here. The fact that the Paste and Match Style is greyed seems to suggest that your copy of Numbers thinks there is nothing in the clipboard... Are you sure you don't have one of the many clipboard enhancement type applications on your machine?


To test that you could try manually copying text into the clipboard (from say, TextEdit) and check to see if Numbers accepts a paste.


Another thing to try: run the script from AppleScript Editor to see if you get the expected results from there.


And also try this: Open Terminal and at the ~ prompt type this command:

date +%H:%M


It should respond immediately with the time in 24-hour format.


If you do get the time as expeced and you can't the the original script to work again, then try the script below, which avoids the clipboard.


SG



tell application "Numbers"

set t to front document's active sheet's first table whose selection range's class is range

tell first cell of t's selection range

set value to do shell script "date +%H:%M"

end tell

end tell

Jun 8, 2014 2:24 AM in response to SGIII

Hi 🙂


OK, that script works fine, although I now can't figure out how to save it as a workflow that I can "import" like the last one.


I've created a new "service" in automator, and added the script, and it adds it to the shortcuts list, but then when I assign a shortcut it doesn't work. Although I DOES work when I run it from automator.


Not knowing automator at all, until this issue, I'm a little lost.


Adam.

Jun 8, 2014 5:00 AM in response to addybails

Adam,


Glad it works.


Do you still have the original service in your Numbers > Services menu? If so, try this:


  1. In Finder hold down the option key and in the menu Go > Library > Services.
  2. Doubleclick the Insert time.workflow package there to open it in Automator.
  3. Select the new script in this thread and command-c to copy it to the clipboard.
  4. Select all the text in the Run AppleScript action in Automator.
  5. Command-v to replace it with the new script (placed on the clipboard in step 3).
  6. Quit Automator, saving changes.


SG




Added: Following the above steps should be the easiest. But to learn how to create an Automator Service from the start, review the steps described in this thread.

Jun 8, 2014 5:19 AM in response to SGIII

Thanks strawberries for that, it worked. And it seems faster than the other option too.


SGIII you're a start, again.


Took a while to figure out a shortcut that was available, but it worked.


It seemed to remember that the original shortcut I used had been assigned before, and didn't seem to want me to use it again, even though I restored defaults in the shortcuts, and checked it.


Thanks again.

Adam.

Jun 27, 2014 2:36 AM in response to addybails

OK, this issue is haunting me.


After setting up the new and better script as an automator app, it worked for about 20 days and then stopped working......again. This is two automator apps that have stopped working now.


I've tried to delete the service and set up again, but it hasn't sorted it out. Also, I've tried using a different shortcut, which hasn't helped, although we haven't set up any other shortcuts anyway, and nothing could be conflicting with it, or it wouldn't have worked the fist time.


When I go to services in finder, and open the app (workflow) in automator, automator opens, and shows insert time.workflow in the title bar, but the script pane is empty.


The other thing that happens, which happened on the old workflow app, is that when you run it, NUMBERS highlights on the menu bar, but EDIT doesn't (for the paste command). And if you trigger it, and then select EDIT manually, the PASTE command is greyed out, as if there is nothing to paste.


So it looks to me like the workflow is NOT getting anything to paste, but it IS activating NUMBERS, as it should, and then it won't paste because there is nothing to paste.


We've also tried the dreaded reboot, to no effect.


Adam.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

workflow no longer working

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.