IWork Numbers -- how to determine the current selected column/row?

I am trying to write a script that grabs some text from a Numbers spreadsheet based on the selected field. I just can't figure how to actually get the column and row in a way I can use. Here's my start:
tell application "Numbers"
tell document 1
-- DETERMINE THE CURRENT SHEET
set currentsheetindex to 0
repeat with i from 1 to the count of sheets
tell sheet i
set x to the count of (tables whose selection range is not missing value)
end tell
if x is not 0 then
set the currentsheetindex to i
exit repeat
end if
end repeat
if the currentsheetindex is 0 then error "No sheet has a selected table."
-- GET THE VALUES OF THE SELECTED CELLS
tell sheet currentsheetindex
set the current_table to the first table whose selection range is not missing value
tell the current_table
set the range_values to the value of every cell of the selection range
set therange to every cell of the selection range
set thecol to column of first item of therange
set therow to row of first item of therange
end tell
end tell
end tell
end tell
It gives me a result like
row "30" of table "table" of sheet "sheet 1" of document "Scheduler.numbers" of application "Numbers"
but what I need is just "30" so I can use it for my scripts. I can't figure how to convert this to a string or some other useful format.
Can anyone help? I like Numbers but I always run into little problems like this, something I can't figure how to do, compared with other scriptable programs.

Search forGetSelParams or better for get_SelParams in the existing threads.
I posted this handler more than 30 times !
Yvan KOENIG (VALLAURIS, France) vendredi 18 mars 2011 17:03:05

Similar Messages

  • How to get the current selected column and row

    Hi,
    A difficult one, how do i know which column (and row would also be nice) of a JTable is selected?
    e.g.
    I have a JButton which is called "Edit" when i select a cell in the JTable and click the button "Edit" a new window must be visible as a form where the user can edit the a part of a row.
    Then the column which was selected in the JTable must be given (so i need to know current column) and then i want the TextField (the one needed to be edited) be active with requestFocus(). So it would be
    pricetextfield.requestFocus();
    Problem now is that i have to click every time in the window the JTextField which was selected in the JTable. I have chosen for this way of editing because my application is multi-user and it would be too difficult for me when everybody did editing directly (catch signals, reload data, etc.).
    My question is how do I know the current column and the current row in a JTable?

    I'm not sure what your mean by the "current" row or column, but the following utility methods return
    which row and column have focus within the JTable.
    public static int getFocusRow(JTable table) {
        return table.getSelectionModel().getLeadSelectionIndex();
    public static int getFocusColumn(JTable table) {
        return table.getColumnModel().getSelectionModel().getLeadSelectionIndex();
    }

  • Need help on how to specify the current select row in a View Object

    Hi,
    I have a ADF table on my page, when I was selecting the rows in this table, I want the set and get methods in the ViewRowImpl class to do some customized actions. I found out that each time regardless the row I select in the table, the viewrowimpl class will always return the data in the first row, I tried to use getCurrentRow in VO row impl. but still, gets the first row.
    Does anyone know how to get the selected row value in the View Object, or View Row Impl rather???
    Thanks!

    Hi,
    you can call a method exposed by the AM and pass teh rowKey of the selected row as an argument. When you configure the exposed AM method in the pageDef (creating a method binding) the argument is shown in a dialog from where you can use EL like #{bindings.iteratorName.currentRow.rowKey} to access the current selected row.
    Frank

  • How to get the current selected value of a combo box or a option button?

    Hello All,
    I want to catch the current selected value of a combo box and also of a option button and want save it into different variables in my code. These option button and combo box are in a SAP business one form which I have created through VB dot.net coding.
    But I don't know how to do that, can any one send any example code for this.
    Regards,
    Sudeshna.

    Hi Sudesha,
    If you want to get the selected values you can do it as follows: The Combo Box value you can get from the combo box. If you want to get it on the change event, you must make sure that you check when BeforeAction = False. If you want to get an Option Button value you should check the value in the data source attached to the option button.
            Dim oForm As SAPbouiCOM.Form
            Dim oCombo As SAPbouiCOM.ComboBox
            Dim oData As SAPbouiCOM.UserDataSource
            oForm = oApplication.Forms.Item("MyForm")
            oCombo = oForm.Items.Item("myComboUID")
            oApplication.MessageBox(oCombo.Selected.Value)
            oData = oForm.DataSources.UserDataSources.Item("MyDataSourceName")
            oApplication.MessageBox(oData.ValueEx)
    Hope it helps,
    Adele

  • How to determine the current update level of the system

    How can we determine the current update level of the system. uname -a shows the release but how to obtain the update level through a program?
    I have this sample program to display the version
    #include <iostream>
    #include <sys/utsname.h>
    #include <dirent.h>
    using namespace std;
    int main()
      struct utsname osinfo;
      // Call uname to get system info, then extract strings.
      uname(&osinfo);
      if (osinfo.machine)  {
        cout<<" Machine : "<<  osinfo.machine;
      if (osinfo.sysname)  {
        cout << "\nOS Name : " << osinfo.sysname;
    if (osinfo.release[0] != '\0')  {
        cout<<"\nRelease : " << osinfo.release;
    }My aim is to check if the Solaris box is 5.10 update 4 or not.
    Edited by: nidhish9 on Nov 27, 2007 5:11 AM

    nidhish9 wrote:
    How can we determine the current update level of the system. uname -a shows the release but how to obtain the update level through a program?
    I have this sample program to display the version
    #include <iostream>
    #include <sys/utsname.h>
    #include <dirent.h>
    using namespace std;
    int main()
    struct utsname osinfo;
    // Call uname to get system info, then extract strings.
    uname(&osinfo);
    if (osinfo.machine)  {
    cout<<" Machine : "<<  osinfo.machine;
    if (osinfo.sysname)  {
    cout << "\nOS Name : " << osinfo.sysname;
    if (osinfo.release[0] != '\0')  {
    cout<<"\nRelease : " << osinfo.release;
    }My aim is to check if the Solaris box is 5.10 update 4 or not.
    Edited by: nidhish9 on Nov 27, 2007 5:11 AMIt's in /etc/release...
    essapd020-u004$ cat /etc/release
                           Solaris 10 8/07 s10s_u4wos_12b SPARC
               Copyright 2007 Sun Microsystems, Inc.  All Rights Reserved.
                            Use is subject to license terms.
                                Assembled 16 August 2007
    essapd020-u004$ It can be processed with some simple commands:
    essapd020-u004$ cat /etc/release | head -1
                           Solaris 10 8/07 s10s_u4wos_12b SPARC
    essapd020-u004$ cat /etc/release | head -1 | cut -f2 -d_ | cut -c1,2
    u4
    essapd020-u004$ Best,

  • JTree: How to get the currently selected node

    How do I get the currently selected node in JTree?
    getLastSelectedPathComponent() this method always return the last selected node and not the current one.
    Thanks in advance
    Sachin

    Use
    TreePath selectedPath = tree.getSelectionPath()If your tree allows multiple selections, use
    TreePath [] selectedPaths = tree.getSelectionPaths() this will return an array of all selected tree paths.
    Once you get the tree path, call the treePath.getLastPathComponent(). this should tell you the currently selected node.
    Hope this helps
    Sai Pullabhotla

  • How to determine the Current Domain name from inside an Mbean / Java Prog

    We have registered an Application Defined MBean. The mbean has several APIs. Now we want to determine the currrent domain using some java api inside this Mbean. Similarly we have deployed a Webapp/Service in the Weblogic domain. And inside this app we need to know the current Domain. Is there any java api that will give this runtime information.
    Note: We are the MBean providers not clients who can connect to the WLS (using user/passwd) and get the domain MBean and determine the domain.
    Fusion Applcore

    Not sure if this will address exactly what you are looking to do, but I use this technique all the time to access runtime JMX information from within a Weblogic deployed application without having to pass authentication credentials. You are limited, however, to what you can access via the RuntimeServiceMBean. The example class below shows how to retrieve the domain name and managed server name from within a Weblogic deployed application (System.out calls only included for simplicity in this example):
    package com.yourcompany.jmx;
    import javax.management.MBeanServer;
    import javax.management.ObjectName;
    import javax.naming.InitialContext;
    public class JMXWrapper {
        private static JMXWrapper instance = new JMXWrapper();
        private String domainName;
        private String managedServerName;
        private JMXWrapper() {
        public static JMXWrapper getInstance() {
            return instance;
        public String getDomainName() {
            if (domainName == null) {
                try {
                    MBeanServer server = getMBeanServer();
                    ObjectName domainMBean = (ObjectName) server.getAttribute(getRuntimeService(), "DomainConfiguration");
                    domainName = (String) server.getAttribute(domainMBean, "Name");
                } catch (Exception ex) {
                    System.out.println("Caught Exception: " + ex);
                    ex.printStackTrace();
            return domainName;
        public String getManagedServerName() {
            if (managedServerName == null) {
                try {
                    managedServerName = (String) getMBeanServer().getAttribute(getRuntimeService(), "ServerName");
                } catch (Exception ex) {
                    System.out.println("Caught Exception: " + ex);
                    ex.printStackTrace();
            return managedServerName;
        private MBeanServer getMBeanServer() {
            MBeanServer retval = null;
            InitialContext ctx = null;
            try {
                //fetch the RuntimeServerMBean using the
                //MBeanServer interface
                ctx = new InitialContext();
                retval = (MBeanServer) ctx.lookup("java:comp/env/jmx/runtime");
            } catch (Exception ex) {
                System.out.println("Caught Exception: " + ex);
                ex.printStackTrace();
            } finally {
                if (ctx != null) {
                    try {
                        ctx.close();
                    } catch (Exception dontCare) {
            return retval;
        private ObjectName getRuntimeService() {
            ObjectName retval = null;
            try {
                retval = new ObjectName("com.bea:Name=RuntimeService,Type=weblogic.management.mbeanservers.runtime.RuntimeServiceMBean");
            } catch (Exception ex) {
                System.out.println("Caught Exception: " + ex);
                ex.printStackTrace();
            return retval;
    }I then created a simply test JSP to call the JMXWrapper singleton and display retrieved values:
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <%@ page import="com.yourcompany.jmx.JMXWrapper"%>
    <%
       JMXWrapper jmx = JMXWrapper.getInstance();
       String domainName = jmx.getDomainName();
       String managedServerName = jmx.getManagedServerName();
    %>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JMX Wrapper Test</title>
        </head>
        <body>
            <h2>Domain Name: <%= domainName %></h2>
            <h2>Managed Server Name: <%= managedServerName %></h2>
        </body>
    </html>

  • How to read the current selection in a table.

    Hello Experts,
    I've this issue with the web dynpro. I have a Adaptive Webservice Model in web dynpro. And I have three tables in the UI. When a row is selected in the first table, the second table is populated with the appropriate data (using a method in the web service.) the same applies to the third table, when the a row is selected in the second table, the third table has to be populated with the appropriate data. The methods in the web service are all working fine. However, in web dynpro, I am not able to figure out on how I read the selected row in a table. Any information on how to resolve this would be really really helpful.
    <
    wdContext.currentGetMailElement().setProfileID("-Should be read from the selected row in the table.");
    wdThis.wdGetMailControllerController().executeGetMail();
    >
    regards,
    Sam.

    Hi Samuel,
    I didnt clearly understood  your problem. When you are selecting a particular row in a table you are executing a web service named Get Mail. Are you passing any input parameter(any selected row data)  while executing a web service. And when you get the response node where you have a attribute in the node getmail. Am I right.
    If this is the case, then first check if the GetMail node is present or not by comparing it will null or checking its size. If the node is null then you will not get attribute as the element itself is null as nothing is retrieved in response. And if the node is not null then the element at 0th position is selected by default. you can retreieve the attribute by directly using the following code
    if(wdContext.nodeGetMail() !=null)
        String profileId= wdContext.currentGetMailElement().getProfileID();
    Check if this works for you.
    Regards,
    Ardhendu Sarkar

  • VS2013 / Team Explorer vsix - How to get the currently selected build definition?

    Greetings,
    My goal with a simple extension is to right-click any build definition and if my "Show Build Def Stats" menu item is selected, pop a message box with some summary details I plan to pull from the IBuildDefinition interface.
    I'm missing something fundamental I'm sure, but I cannot figure out how in the menu handler the actual build definition that I clicked on.
    The menu command is added where I want it successfully:
    Symbol info used to get this there:
        <!-- This is the Build Definition Context Menu -->
        <GuidSymbol name="guidTeamExplorerBuildDefContextMenu" value="{34586048-8400-472E-BBBF-3AE30AF8046E}" >
          <IDSymbol name="menuBuildDefinitionContext" value="0x109"/>
        </GuidSymbol>
    I am stumped as to how to get the fact that I clicked the "ISRepository" build definition in either the Initialize() or MenuItemCallBack() methods, I haven't come across the right service or container object that I recognize.
    Much obliged!
    --Jordan

    I have been investigating this for a while using .NET Reflector and finally I got it:
    In VS 2013, add references to the following assemblies in the folder C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer:
    Microsoft.TeamFoundation.Controls.dll
    Microsoft.TeamFoundation.Build.Controls.dl
    And then use this code:
    Microsoft.TeamFoundation.Controls.ITeamExplorer teamExplorer;
    Microsoft.TeamFoundation.Controls.ITeamExplorerPage teamExplorerPage;
    Microsoft.TeamFoundation.Build.Controls.Extensibility.IBuildsPageExt buildsPageExt;
    teamExplorer = base.GetService(typeof(Microsoft.TeamFoundation.Controls.ITeamExplorer)) as Microsoft.TeamFoundation.Controls.ITeamExplorer;
    teamExplorerPage = teamExplorer.CurrentPage;
    buildsPageExt = teamExplorerPage.GetExtensibilityService(typeof(Microsoft.TeamFoundation.Build.Controls.Extensibility.IBuildsPageExt)) as Microsoft.TeamFoundation.Build.Controls.Extensibility.IBuildsPageExt;
    foreach (Microsoft.TeamFoundation.Build.Controls.Extensibility.IDefinitionModel definitionModel in buildsPageExt.SelectedDefinitions)
    System.Windows.Forms.MessageBox.Show(definitionModel.Name);
    * My new blog about VSX: http://www.visualstudioextensibility.com * Twitter: https://twitter.com/VSExtensibility * MZ-Tools productivity extension for Visual Studio: http://www.mztools.com.

  • SQL Query report - how to evaluate the current sort column?

    Hi,
    I have a need to determine which column has been selected to sort the current report by. I need to pull this column name and pass it when a button is pressed so that the ensuing PDF report generated using PLPDF will be able to sort the data the same way.
    thanks in advance.

    Hi,
    As i think, you need to create report manually using SQL query and for sorting you can put a drop down box and user can select a field name and shorting type that is ASC or DESC from another drop down and than generate a report, additionally you can have another button for exporting to PDF that you can now manage through PLPDF and you can get the shorting column.
    hope this can help you.
    Thanks,
    Jaydip

  • How to determine the current user id!

    I have a table. And when the user insert record, I should insert the information about user who create this record in this table.
    Kostya!

    Here is an example of a trigger I use to populate a primary key and fetch the user
    created the record:
    CREATE OR REPLACE TRIGGER bi_my_table
       BEFORE INSERT
       ON my_table
       REFERENCING NEW AS NEW OLD AS OLD
       FOR EACH ROW
    DECLARE
       c1   NUMBER;
    BEGIN
       FOR c1 IN (SELECT my_table_seq.NEXTVAL next_val
                    FROM DUAL)
       LOOP
          :NEW.primkey := c1.next_val;
          :NEW.user_created := NVL (htmldb_application.g_user, USER);
       END LOOP;
    END;Denes Kubicek

  • How to get to know the current selected service?

    Can anyone tell me how to get the current selected service in MHP? I tried to find one but no result. Can javax.tv.media.MediaSelectControl.getCurrentSelection() gives me the answer?

    servicecontext.getService()

  • How to identify the current lead selection is child or parent in rec node

    Hi
    I am using a recursive node to populate a table with TreeByNestingTableColumn as master column. Now my problem is how do I identify if the current selected row in the table is a child or parent? When I get the lead selection value, I find that its the same for the parent and the child. I am setting the isLeaf and hasChildren boolean properties appropriately as false and true for parent and true and false for child. But since the lead selection is returning the same the below rsTableElement always gives me the parent, I always get those parameter values as that of parent. I am writing this inside the onleadSelect event of the table.
    IRsTableElement rsTableElement = (IRsTableElement) wdContext.nodeRsTable().getElementAt(wdContext.nodeRsTable().getLeadSelection());
    In this scenario how do I know if the current selection is made on a child?
    Appreciate for all help and any code snippets.
    Thanks,
    KN.

    Hi KN,
    I guess you want to check if the node that you selected is parent or child.. This can be achieved by using getTreeSelection() method of IWDNode.
    If you write following code in your lead selection action, you can determine the if it is a parent or child node.
    wdComponentAPI.getMessageManager().reportSuccess(wdContext.nodeRsTable().getTreeSelection() +"");
    the output will be something like
    <ViewName>.RsTable.0.ChildRsTable.1.ChildRsTable.0.. depending upon which node you have selected.
    That way you can find out if it is a parent or child node.
    Abhinav

  • I own a copy of lightroom 5 (a download copy) and have had to install a new hard disk.  I can't remember how I obtained the current copy, but I suspect that i downloaded a trial copy expecting to install the license numbers and I may have downloaded a mon

    I own a copy of lightroom 5 (a download copy) and have had to install a new hard disk. I can't remember how I got the current copy but I think I may have downloaded a monthly rental copy because the program is asking me to pay a subscription fee.  I was expecting to get a message to install my serial numbers.

    You downloaded the trial version for the creative cloud. It doesn't work with a serial number. It is licensed differently. You will have to uninstall it and then download and install from here:
    Product updates

  • How to determine the ROWNUM in a Master Detail Form

    Hello,
    I am working in a Master Detail Form with Orders and Order Items Information; and I created a process that allows the users to select a Product ID on a tabular form, and the next column is populated automatically with the Product Description.
    To achieve that, I followed some instructions by Denes Kubicek (http://apex.oracle.com/pls/otn/f?p=31517:241), but my case is slightly different:
    <ul>I am using a wizard-created tabular form, instead of a manual tabular form; and </ul>
    <ul>Instead of using another page as a Popup to pass the parameter of the ROWNUM, I am using a plug-in called “Tabular Form Super LOV” which is a modified version of the SkillBuilders’ Super LOV that works on Tabular Forms. </ul>
    The Product ID is returned in the correct row by the plug-in; but in the case of the Product Description, it is always returned into the first row; and my problem is that I don't know how to determine the row where the user clicked to call the plug-in.
    I set up an example in apex.oracle.com in case someone would like to look at it:
    Workspace: ediazjorge
    Username: test
    Password: test
    App Name: Sample App
    App Number: 1550
    BTW, I am using Apex 4.1.1.00.23 and Oracle DB 10.3.2.
    Thanks in advance,
    Erick

    Hello VC,
    Thank you for your time and help.
    Unfortunately, it is still not working properly:
    1. When the Popup LOV opens, the first row of the tabular form is 0, the second row is 1, and so on. How can I assign the values starting with 1 and in the format *0001* ? (I am still a novice on Apex and new to JavaScript :-), sorry about that).
    --2. Also, when I close the Popup LOV, the value of P1_ROWNUM is ‘undefined’ again so I'm not sure if the Product Name column will be populated.--
    3. And finally, you are using the jQuery Selector uPopupLOVIcon, which is an attribute of the Cloudy Theme. In my real application (Apex 4.1.1.00.26), my element looks like: *<img src="/i/lov_16x16.gif" width="16" height="16" alt="Popup Lov" alt="List" style="vertical-align:middle;" align="middle" />*. What do you recommend me to use as a jQuery Selector?
    Again, I really appreciate your help and time. I think you solved the most difficult part.
    Thank you so much,
    Erick
    Update: I just found out that the problem with my comment 2 is because I didn’t delete the previous dynamic action that set the value to P1_ROWNUM.
    Edited by: ediazjorge on Sep 18, 2012 11:20 AM

Maybe you are looking for

  • How to use Results from Another Query for SAP BW universes

    Hi Everyone, I have two SAP BI universes.In my First universe I have Sales Doc no (dimension) and Orderqty (Measure) and in my second universe I have Sales Doc no(Dimension) and BillQty (Measure). Here in my first dataprovider I have 1200 rows of dat

  • Print All Colors As Black Using VB Script on CS3

    Is there a way to set all colors as black using a script? I have found the TextAsBlack option, but I also need it to work with images on the page. I have not figured out how to set the ink alias within a script (have not been able to find any informa

  • How can I find the latest update for Firefox 5 without upgrading to Firefox 6.0?

    I had the latest version of Firefox 5 getting automatically upgraded to Firefox 6.0, which disabled my Java 6.022 and 6.023 plugin. Since updating my Java is not an option, because then I can't access my bank account, I uninstalled Firefox 6.0 and in

  • Can't send pictures via text after the update

    I completed the update and can no longer use text to send pictures. When I make the attempt nothing seems to happen. When I later try to send another text to that same number, the texting app just quits. Is anyone else having the same issue?

  • Wired OfficeJet 6500 problem

    Hello, I just recently set up an office printer with the Office Jet 6500 All in one, not the wireless model, however. I can access the printer server's web page and I can printer from within that web page (diagnostics and such) however, I can not pri