Updated Table Name Changes Applescript Operation in Numbers 3.5

I've been using Applescript in Numbers for some time to copy/paste data (set cell values) from one sheet table to another sheet table.
My original script was heavily cribbed from something Yvan Koenig had posted 2-3 years ago.
I recently updated to Yosemite and Numbers 3.5 after testing to ensure my original script remained functional (and it did).
I subsequently updated my source data table by duplicating my old table and editing this new source.
I then updated my Applescript to to reference the new source table.
Testing yielded a good functional result, but Numbers changed its behavior by displaying its work while setting values in the target sheet table.
This obviously slows the script down and adds measurable processing time given the amount of data being moved.
Does anyone know how I can prevent this behavior from occurring?
I don't believe I changed anything material in my original script so I'm really not sure why Numbers changed its behavior.
I have included my script below.  Thanks very much for any help!
property the_goods : {}
property patient_name : {}
property patient_count : {}
property run_date : {}
on run
  set sheet_source to "1500 EXPORT"
  set table_source to "OA Data"
  set column_source to 1
  set row_source to 2
  set sheet_destination to "CLEARING HOUSE EXPORT"
  set table_destination to "Export Table"
  set column_destination to 1
  set nb_rows to 0
  set nb_columns to 244
  set patient_sheet to "SESSION DB"
  set patient_source to "User Input Table"
  set patient_tracker to "Tracking Table"
  set source_column to 3
  set source_row to 2
  set destination_column to 2
  set date_column to 3
  set patient_count_column to 3
  set patient_count_row to 3
  set run_date_row to 5
  tell application "Numbers"
  set document_source to name of front document as string
  set document_destination to name of front document as string
  end tell
  tell application "Numbers"
  tell document document_source to tell sheet patient_sheet to tell table patient_source
  set patient_count to value of cell patient_count_column of row patient_count_row
  set run_date to value of cell patient_count_column of row run_date_row
  end tell
  end tell
  set row_destination to patient_count
  tell application "Numbers"
  tell document document_source to tell sheet sheet_source to tell table table_source
  set the_goods to value of cells column_source thru (column_source + nb_columns) of rows row_source thru (row_source + nb_rows)
  end tell
  tell document document_destination to tell sheet sheet_destination to tell table table_destination
  set r to 0
  repeat with one_row in the_goods
  tell row (row_destination + r)
  set c to 0
  repeat with one_value in one_row
  set value of cell (column_destination + c - 0) to one_value
  set c to c + 1
  end repeat
  end tell
  set r to r + 1
  end repeat
  end tell
  tell document document_destination to tell sheet patient_sheet to tell table patient_source
  activate
  end tell
  tell document document_destination to tell sheet patient_sheet to tell table patient_source
  set patient_name to value of cell source_column of row source_row
  end tell
  tell document document_destination to tell sheet patient_sheet to tell table patient_tracker
  set value of cell destination_column of row row_destination to patient_name
  set value of cell date_column of row row_destination to run_date
  end tell
  end tell
  set the_goods to {}
  set patient_name to {}
  set patient_count to {}
  set run_date to {}
end run

Here is a simple example that copies values from a source row 3 in Table 1 to a target row 5 in Table 2.
On my aging MBA it was very fast (about a second) with 150 columns.
In addition to speed, an advantage of this approach is that you don't have to code table dimensions;  the target table will expand automatically if needed.
Save the script in a script folder (in my case ~/Library/Scripts/Applications/Numbers) and run it from there by choosing it from the script menu. (Running it from Script Editor will paste the values into Script Editor instead of into Numbers as you want).
If keeping the original number format is important, substitute 'formatted value'  for 'value' in the script.
SG
property src : {d:1, s:"Sheet 1", t:"Table 1", r:3}
property tgt : {d:1, s:1, t:"Table 2", r:5}
tell application "Numbers"
  tell document (src's d)
  tell sheet (src's s)
  tell table (src's t)
  tell row (src's r)
  set vv to cells's value -- makes AppleScript list
  set the clipboard to my makeTSV(vv)
  end tell
  end tell
  end tell
  end tell
  tell document (tgt's d)
  tell sheet (tgt's s)
  tell table (tgt's t)
  set the selection range to row (tgt's r)'s cell 1
  tell application "Numbers" to activate
  tell application "System Events" to keystroke "v" using {option down, shift down, command down}
  end tell
  end tell
  end tell
end tell
to makeTSV(aLst) -- turns AppleScript list into tab-delimited string
  set oTID to AppleScript's text item delimiters
  set AppleScript's text item delimiters to tab
  set tsvStr to aLst as text
  set AppleScript's text item delimiters to oTID
  return tsvStr
end makeTSV

Similar Messages

  • SAP BW structure/table name change issue with BODS Jobs promotion

    Dear All, One of my client has issue with promotion of BODS jobs from one environment to another. They move SAP BW projects/tables along with BODS jobs (separately) from DEV to QA to Prod.
    In SAP-BW the structures and tables get a different postfix when they are transported to the next environment.  The promotion in SAP-BW (transport) is an automated process and it is the BW deployment mechanism that causes the postfixes to change.  As a result with the transport from Dev to QA in SAP-BW we end up with table name changes (be they only suffixes), but this does mean that when we deploy our Data Services jobs we immediately have to change them for the target environments.
    Please let me know if someone has deployed some solution for this.
    Thanks

    This is an issue with SAP BW promotion process. SAP BASIS team should not turn on setting to suffix systemid with the table names during promotion.
    Thanks,

  • Failed to update table name (location): Failed to open connection.

    Folks,
    ENV : SQL Server 2005, CR 2008 SP3, Windows Server 2003
    All the reports are working fine except for 4 of them. All of them demonstrate the same symptoms.
    Failed to print/preview report with the error 'A Crystal Reports job failed: Failed to update table name (location): Failed to open connection. Failed to open connection. COA.rpt
    All the reports use OLE DB connection. I have verified the the DB Connection Information. It's the same across all the rpt files.
    Please help.
    Regards,
    Balaji K

    Hi,
    Additional Info:
    CR 2008 SP3 is called by an application using .net. The Application passes a couple of parameters to the CR report. I'm able to preview the report. All the reports use the same set of parameters.
    Balaji K

  • Database "TABLE" name change is NOT reflecting on Designer Security

    Hi all members,
    version: BOXI 3.1
    I have change the table name in my Database for some particular reason.
    After changing the name from "A_Table" to "B_Table" it is updating the objects "select"  information correctly by itslef. BUT for security in (Manage Access Rights) old Table name is showing.
    Manaul correction is the only way for it? Can this be updated automatically.
    What is the way to achieve it through SDK.
    Kindly any member guide me.
    I have number of tables to change and each have number of securities applied in universe.
    Thanks in advance
    Regards,
    Izhar

    Universe access security is encapsulated separate from the Universe unv itself.
    Rather, it's a SI_KIND='Overload' InfoObject instance, accessible using the BusinessObjects Enterprise SDK.
    Sincerely,
    Ted Ueda

  • Handling table name changes

    Hi,
    Because of a change in naming convention, all our source table names are changing (only the prefix: The rest of the name and the table structures will remain the same). We already have developed a significant number of OWB mappings based on the old naming convention. What is the OWB equivalent of doing a global search replace of table names ? Is there a script available for doing this ?
    Thanks in advance.
    Regards,
    Biswa.

    The name changing part should be relatively simple to handle. I have included a script that should do the renaming with the prefix 'WH_'. The reconcile will have to be done by you. The script should go something like this (please test your scripts in a test environment as I will not provide support for this).
    Regards:
    Igor
    # Update the connection information here.
    # The connect string format is repository_user/repository_pwd@hostname:port:service_name
    # Connecting to the repository:
    OMBCONNECT owb/owb@localhost:1521:ora9201
    puts "Connected to repository."
    # Setting the project and prefix variables (set project name here):
    set MProject MY_PROJECT
    # Everything will be prefixed by WH_:
    set wh WH_
    #Open the project
    # Entering into the Project (CC = Changing Context):
    OMBCC '$MProject'
    set module_list [OMBLIST ORACLE_MODULES]
    # Loop to enter into each project module:
         foreach i in {$module_list}{
              puts "Working on module: $module_list ."
              OMBCC '$module_list'
              set table_list [OMBLIST TABLES]
    # Loop to prefix the name of each table in the current module:
                   foreach j in {$table_list}{
                        puts "     Working on table: $table_list ."
                        OMBALTER TABLE '$j'
                             RENAME TO '$wh$j'
    # Loop to prefix the name of each dimension in the current module:
              set dim_list [OMBLIST DIMENSION_TABLES]
                   foreach l in {$dim_list}{
                   puts "     Working on dimension: $dim_list ."
                        OMBALTER DIMENSION_TABLE '$l'
                             RENAME TO '$wh$l'
    # Loop to prefix the name of each cube in the current module:
              set cube_list [OMBLIST CUBE_TABLES]
                   foreach m in {$cube_list}{
                   puts "     Working on cube: $cube_list ."
                        OMBALTER CUBE_TABLE '$m'
                             RENAME TO '$wh$m'
    # Loop to prefix the name of each mapping in the current module:
              set mapping_list [OMBLIST MAPPINGS]
                   foreach k in {$mapping_list}{
                   puts "     Working on mapping: $mapping_list ."
    # Reconcile your mapping here by using OMBRECONCILE ...
    # this will have to be done by you...     
    puts "Done."
    # Saving the changes:
    OMBCOMMIT
    # Disconnecting from the repository:
    OMBDISCONNECT

  • Related to ACD(Add chage Delete) for extend button  need update table name.

    In which table the data(new material number , the plant number etc.) are updated for ACD(Add Change Delete) when a new material is included in plant or extend from one plant to another plant in material Management(MM).Any pointer from any side will help me a lot...
    Thanks in advance
    Azizur.

    Hi,
    You can check all the material master tables and
    other material related tables from t-code SE11.
    There in the table name area you have to write
    MA* and press F4,it will fetch you all the material
    related tables in a drop down.
    Hope it helps
    Regards
    Mansi

  • Update table name.

    Hi,
    I created a new form UD_NEWFORM in form designer and by mistake I clicked save in form designer table and the form with table name UD_ADGRP got renamed to UD_NEWFORM.
    How can I change this to UD_ADGRP again ?

    Well I dont think you would ever be able to update the table name, even if you open some other form, click new and then save for that newly created form. It will just create another entry for this new form. Do a wild search for all the forms and you should be able to see your form UD_ADGRP over there. So nothing is over-written.
    Thanks
    Sunnny

  • Table name changed in Reports 3.0

    My DBA asked me to change the table name from SA_AWARDS to SAFETY_AWARDS.
    I had already developed a report using table name SA_AWARDS.
    When I change the table name in my report to SAFETY_AWARDS, I get compilation errors.
    How can I fix it ?
    Thanks.
    Suresh

    Hi
    As i understand your problem , you have changed the table name in the query wizard and then tried to compile and it is giving errors ....
    well anytime you modify the sql (even add a space) the column names are renamed ... ie if you originaly had column Customer_name it would be renamed as customer_name1 ....
    now if in the original report you are using the columns for any computation etc it will not find the old column and will give compilaiton errors .... one way is to change the column names back to original names ... or better modify the sql once more by adding space and you will get back the original names most of the times .....
    the best way to avoid this is give alias name in the sql first time around , so it dosnt create problems ....
    once you take care of this i think your problem should be solved .....
    if not do let me know in more detail
    bye
    sudhir

  • InDesign CS4: File names change to string of numbers

    Occasionally, one of our users will save an InDesign CS4 file, only to have the file name change.  For example, a file originally named "#kwn25501.bcbsNM.indd" was saved as "#kwn25501.bc157-1223857848."
    If the user is not aware that this has happened, things can go horribly, terribly wrong in our production environment. The "numbered" file may be missing key elements, or be somehow be corrupt in some fashion. In one case, this led us to having to reprint a job because the "numbered" file was missing a photo; somehow, that file was used (and perhaps renamed after the fact) to create the final output.
    We use Macs running InDesign CS4 6.0.5. Some of our Macs are running Tiger 10.4.11, while others are running Leopard 10.5.8. The problem seems to related to the Leopard machines, although that is not 100 percent certain at this point. All of these Macs are bound to Active Directory and save files to a Windows 2003 server. I know Adobe recommends against working on files over a network, but perhaps there is an explanation for this file renaming aside from network issues.
    Any light that can be shed on this issue will be greatly appreciated. Thanks!
    Kevin Stauffer

    Check to see if maybe your original filename is the problem.
    You may need that particular name for a workflow reason, but some of the symbols in the middle of your filename are generally not a good idea. Especially working off of a server, file names should be ONLY alpha-numeric characters, no symbols, no periods (except for the file type) and only underscores or dashes to separate words, no spaces.
    The reason is some of those symbols get picked up as machine language and all sorts of bad can happen as a result.
    Message was edited by: Michael Riordan

  • Table Name-Changes in SO

    Dear All,
    As we all know that any changes done in Sales order, we can see them by going to Va02-->Environment -->Changes...
    According to our client's requirement, we need to generate a report which can show all the changes done to a SO. For this I want to know the TABLE name in which the changes that we have done to the SO are going to be stored.(Kindly let me know if there is any Standard Report exists in SAP R/3 for this kind of requirement)
    Points assured for Helpful answers
    Thanks & regards
    Krishna Chaitanya

    Hi,
    Please refer the following tables.
    Header : CDHDR
    Item: CDPOS
    Reward points
    Regards,
    Govind.

  • How Discoverer Reports cope with table name changes

    I want to change the name of an oracle table that is queried by a number of Discoverer reports owned by various users.
    I have been told that Discoverer might have the smarts to handle this without manual intervention of users having to open their reports and repoint them to the new tablename. Would someone be able to enlighten me?

    Thanks Guys for help.
    Additionally I'd like to add for the purpose of the name change is business driven and therefore it is important that business (report writers) see the new name so.....
    For each simple folder in the EUL there are there 3 attributes you need to be aware of:
    (1) Folder Name (the name as seen in Discoverer)
    (2) Identifier
    (3) Physical Database Object name
    (1) and (2) are used by a Disco workbook to resolve back to the physical object name.
    Therefore, you can change either (1) or (2) [but not both] and still have the workbook resolving back to the physical object name on the folder (ie (3)).
    In summation, I changed (1) and (3) while leaving (2) unchanged to resolve the whole glorious mess....

  • Admin advice: table name changes, etc.

    Our Discoverer system is still evolving and there are instances when a change, say to a table name that users have build workbooks on, is required. Is there a way to scan the workbooks and make this change for the users?

    Hi
    No, this is not possible. You have to be extremely careful making changes to an EUL after workbooks exist. Mind you, just because you change a table name does not mean you need to change the folder name or identifier. You can change the table pointer without making any other changes, so long that is that the new table has the same data items and data types as the original. If it doesn't you could be in deep trouble.
    As a note, you do need to make sure that you correctly maintain both the folder name and the folder identifier and not allow these to take generic names and defaults such as NEWFOLDER1 etc. This is bad EUL design and you will end up with issues in the future.
    If you have a copy of my Oracle Discoverer 10g Handbook, available from good bookstores or amazon.com via http://learndiscoverer.com/books/books.htm, take a look at chapters 17 and 18 which describe in detail how to get going in and maintain business areas. In particular, pages 640 and 641 cover folder management and discuss the impact of changing names and / or identifiers.
    I hope this helps
    Best wishes
    Michael Armstrong-Smith
    URL: http://learndiscoverer.com
    Blog: http://learndiscoverer.blogspot.com

  • Table name change in procedure dynamically

    create table tab1(x number);
    create table dynamic_table (x number);
    insert into tab1 values (1);
    insert into dynamic_table values (1);
    commit;
    create procedure proc1
    is
    v_x number;
    begin
    execute immediate 'create table mytab
    as select tab1.*
    from tab1, tabc
    where tab1.x = dynamic_table.x';
    end;
    begin
    proc1;
    end;
    /dynamic_table --> should be dynamically replaced in the procedure
    There are two more tables in this scenario - tabe and tabf, In the above procedure, I have to dynamically replace dynamic_table first with tabe, call it, then then replace with tabf and execute procedure again
    Is there a way I can do that ? any dynamic sql that will prompt me to call proc1 twice, 1st time replace dynamic_table with tabe, then with tabf
    the structure of tabe and tabf is the same, I am currently passing a parameter to the procedure and replacing dynamic_table with the input parameter, and then
    calling the procedure twice by passing the table names, wanted to follow a better approach
    Currently, I am doing somethig like this:
    create procedure proc1 (i_param in varchar2)
    is
    v_x number;
    begin
    execute immediate 'create table mytab
    as select tab1.*
    from tab1, tabc
    where tab1.x = i_param.x';
    end;
    begin
    proc1('tabe');
    proc1('tabf');
    end;
    /

    Why are you trying to do this?
    Good database design practice means that you don't create tables dynamically within your code.
    Why do you have tables of the same structure with different names?
    Dynamic table names are not a good idea because it means all your code has to be dynamic.
    So whilst it's perfectly possible to do what you are asking, showing you how to do it would be like me showing you how to fly a plane into the ground, i.e. not something that's clever or wise.
    So, better you explain what problem you are trying to solve rather than ask us how to improve on the poor code you are already trying to do.

  • Update table on change of field detected by javascript

    Good afternoon HTML DBers.
    I am not familiar with Javascript...and I think I will need it to solve the following problem...and so I have posted this request.
    I have a multi line report with one updateable field in each row(a quantity field). When the user updates this field on any of the rows, I wish to update an oracle table with the new quantity value.
    From my reading, I suspect that I may need some 'OnChange=' javascript to pick up when the field is updated.
    Then I guess I would somehow set up a REQUEST value that I would identify in a process to do the UPDATE of the table.
    But how do I send the unique key (the order number) of the row where the quantity value has been changed?
    Thankyou in anticipation. Tony Calabrese. 27/9/2004

    Forget javascript, Tony.
    The MRU mechanism updates what needs to be updated provided you submit the page. Then, after updating the fields, you may branch to another page or reload the current one (by branching to the same page number).
    Javascript works on the client side, your data is stored on the server side, so, in general, it's very hard to update the server side with client data unless you submit a form.
    MRU works fine, don't be scared by the need of reloading the page.
    Bye,
    Flavio

  • Have tables names changed from CF6/7 to CF 8/9?

    <<Edit>>I might have just answered my question, sort of.  I had already exported the data from the hosted SQL 2000 DB to my local SQL 2000 DB and then backed up and restored it to an empty DB in SQL 2008 Express.  The tables have the dbo. prefix instead of the "xx." prefix in the other DB which went from SQL 2000 to SQL 2008.  The site runs with the dbo. prefix.  Any links to articles/videos/summaries of simple differences between version still appreciated."<</Edit>>
    I built a CF6/7 based site about 5 years ago and I'm trying to move it to the current versions of MSSQL (2008R2 Express) and CF9.  I believe the SQL DB is fine, I have setup the site on the local server, and am getting the following error when trying to view a page that access the DB.
    [Macromedia][SQLServer JDBC  Driver][SQLServer]Invalid object name 'client_info'.
    I exported the DB data from the live DB server into my local SQL 2008 Express and tables now have names like "xx.client_info"  Is it correct to assume that this is a new naming convention so that you can access easily access tables in multiple DBs?  Would I simply need to rename the tables to exclude the "xx." at the begining?  Or would it be advised to export the data into SQL 2000 and then backup/restore the DB to SQL 2008 Express?
    Thanks for any help, and if there's a video or link to simple differences/improvements in CF from 6/7 to 8/9 any link would be greatly appreciated.

    It's not CF-related, it's a SQLServer thing. In SQL 2008 they introduced the concept of Schemas, which I think is what you're seeing here. Rather than dbo.tablename, you now have schema.tablename.
    I don't know the details to be honest, but that's what you need to be looking at.
    O.

Maybe you are looking for