Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Input "data" to a specific numbers doc / month sheet-

I would like to run an apple script. get a popup (which is done already) and take that value and add it to a specific numbers document and create a sheet name by "year / month and add the data to the first row and cell. And to the next cell to add the current date that it has been added.


and if I run the script again. add the new "datas" to a row below.


visual example:


User uploaded file


so popup input. 60 then autoadd current date to second column. and the 60 to the first one which I inputted.

and if I add a new input then add it to the next row etc. And when It's a new month create a new sheet with year/ month name


Please help 🙂


I'm new to this.


Thank you!!!

numbers app, apple script-OTHER, OS X El Capitan (10.11), apple script help

Posted on Oct 13, 2015 7:27 AM

Reply
35 replies

Oct 16, 2015 1:59 PM in response to SGIII

Hey, Thanks for your reply!


I would like to input invoice numbers. But I already have a script for the popup and it sends the invoice input number to a certain person in a certain "text blabla "this is the number" on "Date" greetings okaypol. Works great but I would like to add to the script that is even saves it in a numbers document as well, if my boss can't figure out one-by-one what I sent. So it would be a back up plan, just in case. if he says he is bored to check all the text and calculate them I could just print it out for him. 😁

Oct 28, 2015 12:37 PM in response to okaypol

okaypol wrote:


Sends Data as sms to a phone number. (this part is done)


Done? How are you doing it?


okaypol wrote:


Saves Data to a numbers doc.


An existing Numbers doc? If so what does your doc look like and where do you want the data to be added?


Specific questions and information will be more likely to result in specific answers.


SG

Oct 28, 2015 12:22 PM in response to okaypol

If I understand you correctly, a simple script like this will place the values as shown in your screenshot, with the price in A2 and the time in B2. This assumes the document is open and in front of any others that you have open at the same time.


(If you were to place more than one value in that table, placing each new value in the next empty row or something like that, then this would have to be more sophisticated.)


SG


display dialog "The invoice Pricetag " default answer ""

set kod to result'stext returned

set FutureDate to current date

tell application "Messages"


--your code here

end tell

tell application "Numbers"

tell front document

tell sheet "Checklist"

tell first table

set cell "A2"'s value to kod

set cell "B2"'s value to FutureDate

end tell

end tell

end tell

end tell

Oct 28, 2015 12:26 PM in response to SGIII

Sorry I am new to this forum, marked "helped" yout post 🙂


The problem I have now that, how can I make it just the cell that is full?

(because whenever I run the applescript it overwrites the old data.) How to make it always write to a new row?

And to open the Numbers file and add it to that?


I am very very thankful for your help 😉! really!

Oct 28, 2015 1:10 PM in response to okaypol

okaypol wrote:


How to make it always write to a new row?

And to open the Numbers file and add it to that?




Does the script below do what you want? It assumes you are adding values to a table that looks like this:


User uploaded file


You can change properties as needed to match your setup. You can get the tgtDoc path for your Numbers document by selecting the document in Finder and dragging it into the Script Editor window.


SG



property tgtDoc : "/Users/sg3/Desktop/MyDoc.numbers"

property tgtSht : "Checklist"

property tgtTbl : 1

property amtCol : "A"

property dateCol : "B"


display dialog "The invoice Pricetag " default answer ""

set kod to result'stext returned

set FutureDate to current date

tell application "Messages"


--your code here

end tell


tell application "Numbers"


opentgtDoc


activate

tell front document

tell sheet tgtSht

tell table tgtTbl

try

set insertRow to address of first row whose first cell's value is missing value

on error


add row below last row

set insertRow to address of first row whose first cell's value is missing value

end try

set columnamtCol'scellinsertRow'svalue to kod

set columndateCol'scellinsertRow'svalue to FutureDate

end tell

end tell

end tell

end tell

Input "data" to a specific numbers doc / month sheet-

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