AppleScript for copy and paste in Numbers.
Dear All
Firstly I still practical and learning AppleScript.
Referring this AppleScript as I understood, it should be create table with header and also, it will be reading and paste data each row until end of records (equal count row)
tell application "Numbers"
tell front sheet of front document
set myOriginaltable to front table
set myRows to count the rows in myOriginaltable -- count rows
set myCols to count the columns in myOriginaltable -- count column
set myNewtable to make new table with properties {column count:myCols, row count:myRows} -- create table
-- create header --
set value of cell 1 of row 1 of myNewtable to "!TIMEACT"
set value of cell 2 of row 1 of myNewtable to "BILLINGSTATUS"
set value of cell 3 of row 1 of myNewtable to "DATE"
set value of cell 4 of row 1 of myNewtable to "DURATION"
set value of cell 5 of row 1 of myNewtable to "EMPLOYEE"
set value of cell 6 of row 1 of myNewtable to "ITEM"
set value of cell 7 of row 1 of myNewtable to "JOB"
set value of cell 8 of row 1 of myNewtable to "NOTE"
repeat with i from 2 to myRows -- start write in row 2
set myDate to value of cell 3 of row i of myOriginaltable
set myDur to value of cell 5 of row i of myOriginaltable
set myItem to value of cell 2 of row i of myOriginaltable
set myJob to value of cell 7 of row i of myOriginaltable
set myNote to value of cell 8 of row i of myOriginaltable
tell row i of myNewtable
set value of cell 1 to "!TIMEACT"
set value of cell 2 to "1"
set value of cell 3 to myDate
set value of cell 4 to myDur
set value of cell 5 to ""
set value of cell 6 to myItem
set value of cell 7 to myJob
set value of cell 8 to myNote
end tell
end repeat
end tell
end tell
I had question is, if would like to read data each row but paste in only 2 columns and repeat it until end of data in column (equal count row). Please suggest.
Raw Data
Expectation
MacBook Pro (13-inch, 2017, 4 TBT3), macOS High Sierra (10.13.3), null