Help with AppleScript for Numbers - please!

I posted a question on the AppleScript section, if anyone can help...
https://discussions.apple.com/thread/3451760
Thanks!
(I'm trying to get an array into what I know of in Excel as a "range". How can this be done with numbers?)

Does this help?  This would work if tagValues in your script is a single value.
tell application "Numbers" to tell document 1 to tell sheet 1 to tell table 1
          set selection range to range "B2:D5"
          set tagvalues to 1
          set value of cell in selection range to tagvalues
end tell
If tagValues is a list, you may have to set each cell separately, indexing through each value in tagValues.

Similar Messages

  • Problem with applescript for Numbers

    I am new to Applescript and am haveng problems with what seems to be a pretty simple task.  I want to check the value of each cell to test for a certain condition and then based on the results increment another cell.  I keep getting the following error:
    error "Numbers got an error: Can’t make {4, 5} into type integer." number -1700 from {4, 5} to integer
    Here is my script:
    tell application "Numbers" to tell document 1 to tell sheet "Sheet 1" to tell table "Table 1"
              set fNineStart to 4
              set fNineEnd to 12
              set bNineStart to 14
              set bNineEnd to 22
              repeat with irow from 8 to 40
                        set skinscount to 0
                        repeat with jcol from fNineStart to fNineEnd
                                  set minscore to value of cell (jcol & 5)
                                  if value of cell (jcol & irow) is equal to minscore and the value of cell (jcol & 6) is equal to 1 then
                                            set skinscount to skinscount + 1
                                  end if
                        end repeat
                        set the value of cell (27 & irow) to skinscount
              end repeat
    end tell
    Here is the spreadsheet:
    Name
    1
    2
    3
    4
    5
    6
    7
    8
    9
    Front
    Nine
    10
    11
    12
    13
    14
    15
    16
    17
    18
    Back
    Nine
    Total
    Net
    ESC
    score
    Skins
    Par
    4
    4
    4
    5
    3
    4
    5
    3
    4
    36
    4
    5
    3
    4
    5
    3
    4
    4
    4
    36
    birdie
    3
    3
    3
    4
    2
    3
    4
    2
    3
    27
    3
    4
    2
    3
    4
    2
    3
    3
    3
    27
    eagle
    2
    2
    2
    3
    1
    2
    3
    1
    2
    18
    2
    3
    1
    2
    3
    1
    2
    2
    2
    18
    low score
    3
    4
    4
    3
    3
    4
    5
    3
    4
    4
    4
    3
    4
    5
    3
    4
    4
    4
    # of people with min.
    1
    3
    1
    1
    1
    2
    4
    1
    2
    16
    2
    1
    2
    3
    3
    2
    1
    4
    2
    Skins
    HCP
    Joe
    y
    3
    3
    4
    5
    5
    3
    4
    5
    4
    5
    38
    5
    5
    4
    4
    5
    3
    4
    4
    5
    39
    77
    74
    Bill
    y
    7
    5
    4
    5
    5
    4
    4
    5
    4
    4

    Hi fairchild.bill,
    Real experts will I hope chime in, but I think one problem is the way you are referring cells:
    Instead of:
    value of cell (jcol & irow)
    I think you need to use something like:
    value of cell irow of column jcol
    And
    value of cell jcol of row irow
    Studying examples of scripts for Numbers 3 at macosxautomation.com may give you some ideas on this.
    SG

  • Help with AppleScript for outlook 2011

    I wonder if anyone can help me with what I think should be a simply script.
    I simply want to sweep(move) all of my incoming mail in Outlook to a specified IMAP folder.
    Is this possible - it seems like it should be an easy script - if you get me started with the outline (for select all in incoming box and the move to an imap folder command) I think I can sort it.
    Many thanks!
    Gordon    

    I wrote a script to perform email-merges using Outlook or Mail/Address Book: https://github.com/craibuc/applescript-email-merge.  Perhaps you will find it useful.

  • I need help with AppleScript for changing the font on numerous PowerCADD files

    I am currently trying to write an AppleScript, but I really have no idea how one is written.  I have looked up many tutorials, but to no avail.
    What I'm trying to so is write a script that will take all my selected PowerCADD files, open them, change the font to Helvetica, then save the file.  I have over a thousand files to do this to.  So, you can see my need of an AppleScript to get this task completed.
    If anyone out there knows how I would write this script, please submit it here.
    Thank you so much for your time and help.

    If anyone could help, that would be awesome  =)

  • Need help with a for loop please

    Hello,
    I want to do the following:
    double V[][] = sphere.V2;
    double polygon[][][] = {
         { V[0], V[1], V[2] },
    { V[1], V[2], V[3] },
    { V[2], V[3], V[4] },
    { V[3], V[4], V[5] },
    { V[4], V[5], V[6] },
    { V[124], V[125], V[126] },
    How can I set up a loop to initialize the values of polygon so that I dont have to type it all out?
    Thanx a lot
    -Big_Goon

    Any suggestions?
    -Big_Goon

  • Help with updates for CS6

    I need help installing latest updates for CS6.  I have Win 7 and have tried updating from the Help - Updates menu.  The error is:  U43M1D207.

    Thanks for your response.  I am in the United States in So. Arizona.
    Date: Fri, 5 Oct 2012 12:21:45 -0600
    From: [email protected]
    To: [email protected]
    Subject: Help with updates for CS6
    Re: Help with updates for CS6 created by Jeff A Wright in Downloading, Installing, Setting Up - View the full discussion
    Crunkle1 you are welcome to work directly with our support team for guided assistance.  If you go to http://www.adobe.com/ and select Help and Contact Us you should be given the option to contact our support team via telephone.  Which country/region are you in?
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/4752605#4752605
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4752605#4752605
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4752605#4752605. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Downloading, Installing, Setting Up by email or at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Help with Applescript - filenames

    Hi!
    I hope there is someone who can help me. I have very little experience with Applescript, and have spent a couple of days scouring these forums amongst others without any luck...
    I have a folder (titled XLS) with about 1000 excel files in it. They are numbered basen on some parametric calculations (1111.xls, 1112.xls, 1113.xls, etc). I have constructed an Automator rutine which, one at a time, can open each excel file, copy some cells and then paste the data into an empty xml-file in TextWrangler. The empty xml-file is also in the XLS folder.
    What I am looking for is an applescript which can rename the open xml-file with the same filename as the xls-file. So, when 1111.xls is open, the xml-file gets renamed 1111-xml; when 1112.xls is open, the xml-file gets renamed 1112-xml, etc. Each new xlm-file is to be saved into a folder XLM, whivh is also in the XLS folder.
    Thanks in advance....
    Rob

    Se below; there are two folders on the desktop; "xls" (with xls-files in) and "xml", as well as the empty Template.xml file. Here it is!:
      --3 XLS to XML
              tell application "Finder"
                        set fileList to every file of entire contents of ("YourHD:Users:You:Desktop:xls" as alias)
              end tell
              repeat with i from 1 to number of items in fileList
                        set currentFile to (item i of fileList)
                        tell application "Microsoft Excel"
                                  set screen updating to false
      open currentFile
      activate currentFile
      activate object worksheet 1
                                  copy range range ("YourRange")
                        end tell
                        tell application "Finder"
                                  copy file "YourHD:Users:You:Desktop:Template.xml" to folder "YourHD:Users:You:Desktop:xml"
                        end tell
                        tell application "Microsoft Excel"
                                  set docName to name of window 1
                        end tell
                        tell application "Finder"
                                  set docName2 to text 1 thru ((offset of "." in docName) - 1) of docName
                                  set theFile to "YourHD:Users:You:Desktop:xml:Template.xml" as alias
                                  set the name of theFile to docName2 & ".xml"
      open file theFile
                        end tell
                        tell application "TextWrangler"
      activate
      paste
      close text document 1 saving yes
                        end tell
                        tell application "Microsoft Excel"
      activate
      close active workbook saving no
                        end tell
              end repeat
              tell application "Microsoft Excel"
                        set screen updating to true
      quit
              end tell
              tell application "TextWrangler"
      quit
              end tell

  • I need help with my for loop in this array

    Ok well, I can't get my code to work. Also, please remember that this is just my draft so it isnt pretty. I will fix it up later so please look at it. The thing I want to do is look into the array for a time that matches what the user entered and return the toString() of that one. I know there is something wrong with my for loop but I cant figure how to fix it. please help. here is what i have so far:
    import javax.swing.JOptionPane;
    public class Runner
        public static void main (String[] args)
            String timeStr;
            int time, again, optiStr;
            Inbound[] in = new Inbound[25];
             in[0]=new Inbound ("",0,"On Time num0");
             in[1]=new Inbound ("",2,"On Time num1");
             in[2]=new Inbound ("",3,"Delayed num2");
             in[3]=new Inbound ("",4,"On Time");
             in[4]=new Inbound ("",5,"On Time");
             in[5]=new Inbound ("",6,"Canceled");
             in[6]=new Inbound ("",1,"Canceled num6");
             in[7]=new Inbound ("",8,"On Time");
             in[8]=new Inbound ("",9,"Delayed");
             in[9]=new Inbound ("",10,"On Time");
             in[10]=new Inbound ("",11,"Delayed");
             in[11]=new Inbound ("",12,"On Time");
             in[12]=new Inbound ("",13,"Delayed");
             in[13]=new Inbound ("",14,"On Time");
             in[14]=new Inbound ("",15,"On Time");
             in[15]=new Inbound ("",16,"On Time");
             in[16]=new Inbound ("",17,"Canceled");
             in[17]=new Inbound ("",18,"On Time");
             in[18]=new Inbound ("",19,"On Time");
             in[19]=new Inbound ("",20,"Canceled");
             in[20]=new Inbound ("",21,"On Time");
             in[21]=new Inbound ("",22,"Delayed");
             in[22]=new Inbound ("",23,"On Time");
             in[23]=new Inbound ("",24,"Cancled");
             in[24]=new Inbound ("",7,"On Time num24");
            do{
                timeStr = JOptionPane.showInputDialog ("In military time, what hour do you want?");
                time = Integer.parseInt(timeStr);
                if (time<=0 || time>24)
                 JOptionPane.showMessageDialog (null, "Error");
                 optiStr = JOptionPane.showConfirmDialog (null, "If you want Incoming flights click Yes, but if not click No");
                if (optiStr==JOptionPane.YES_OPTION)
    //(ok this is the for loop i am talking about )
                    for (int index = 0; index < in.length; index++)
                      if ( time == Inbound.getTime())
                   JOptionPane.showMessageDialog (null, Inbound.tostring());  //return the time asked for
    //               else JOptionPane.showMessageDialog (null, "else");
                }//temp return else if failed to find time asked for
    //             else
    //               if (optiStr==JOptionPane.CANCEL_OPTION)
    //                 JOptionPane.showMessageDialog(null,"Canceled");
    //              else
    //                {Outbound.run();
    //                JOptionPane.showMessageDialog (null, "outbound");}//temp
                  again=JOptionPane.showConfirmDialog(null, "Try again?");
            while (again==JOptionPane.YES_OPTION);
    }any help would be greatly appriciated.

    rumble14 wrote:
    Ok well, I can't get my code to work. Also, please remember that this is just my draft so it isnt pretty. I will fix it up later so please look at it. The thing I want to do is look into the array for a time that matches what the user entered and return the toString() of that one. I know there is something wrong with my for loop but I cant figure how to fix it. please help. here is what i have so far:
    >//(ok this is the for loop i am talking about )
    for (int index = 0; index < in.length; index++)
    if ( time == Inbound.getTime())
    JOptionPane.showMessageDialog (null, Inbound.tostring());  //return the time asked for
    Inbound.getTime() is a static method of your Inbound class, that always returns the same value, I presume? As opposed to each of the 25 members of your array in, which have individual values?
    Edited by: darb on Mar 26, 2008 11:12 AM

  • Help with applescript to quit certain processes by name?

    Hey, for anyone who knows how to program applescripts well, I could use some help with the script below.
    I'm very new to applescripting and I'm trying to write a script that would automatically quit up to 100 instances of the Google Chrome Renderer process.
    Thanks to google, I found a script similar to what I wanted, and after some tinkering I thought I had it just right. The thing is, if I only set the app_name to Google Chrome, it quits Chrome just fine, but when I try it like this, it doesn't receive any data from grep or awk.
    If anyone can help I'd really appreciate it.
    repeat 100 times
              set app_name to "Google Chrome Renderer"
              set the_pid to (do shell script "ps ax | grep " & (quoted form of app_name) & " | grep -v grep | awk '{print $1}'")
              set new_pid to first word of the_pid
              try
                        if new_pid is not "0" or "1" then do shell script ("kill -9 " & new_pid)
              end try
    end repeat

    try this:
    tell application "System Events"
              set procs to (every process whose name is "Google Chrome Renderer")
              if (count of procs) > 100 then
                        set max to 100
              else
                        set max to count of procs
              end if
              repeat with i from 1 to max
                        tell (item i of procs) to quit
              end repeat
    end tell

  • Need some help with the colour profile please. Urgent! Thanks

    Dear all, I need help with the colour profile of my photoshop CS6. 
    I've taken a photo with my Canon DSLR. When I opened the raw with ACDSee, the colour looks perfectly ok.
    So I go ahead and open in photoshop. I did nothing to the photo. It still looks ok
    Then I'm prompt the Embedded Profile Mismatch error. I go ahead and choose Discard the embedded profile option
    And the colour started to get messed up.
    And the output is a total diasater
    Put the above photo side by side with the raw, the red has became crimson!!
    So I tried the other option, Use the embedded profile
    The whole picture turns yellowish in Photoshop's interface
    And the output is just the same as the third option.
    Could someone please guide me how to fix this? Thank you.

    I'm prompt the Embedded Profile Mismatch error. I go ahead and choose Discard the embedded profile option
    always use the embedded profile when opening tagged images in Photoshop - at that point Photoshop will convert the source colors over to your monitor space correctly
    if your colors are wrong at that point either your monitor profile is off, or your source colors are not what you think they are - if other apps are displaying correctly you most likely have either a defective monitor profile or source profile issues
    windows calibrate link:
    http://windows.microsoft.com/en-US/windows7/Calibrate-your-display
    for Photoshop to work properly, i recall you want to have "use my settings for this device" checked in Color Management> Device tab
    you may want to download the PDI reference image to check your monitor and print workflows
    and complete five easy steps to profile enlightenment in Photoshop
    with your settings, monitor profile and source profiles sorted out it should be pretty easy to pinpoint the problem...

  • Help with display of numbers

    First of all I have to say the tutorials on this site are extremely helpful. My instructor wants all our java code written as Object Oriented and when I did a search on here for Object Oriented it totally helped out. Now I just need help with the display of numbers, my code works perfectly fine except that the number has wayyyyyyyyyyy to many decimal points after it. I only wanted two.
    public class Mortgage
         double mtgAmount;
         double mtgTerm;
         double mtgRate;
         double monthPymt;
              public void Amount(double newValue)
                     mtgAmount = newValue;
              public double Amount()
                   return mtgAmount;
              public void Term(double newValue)
                     mtgTerm = newValue;
              public double Term()
                   return mtgTerm;
              public void Rate(double newValue)
                     mtgRate = newValue;
              public double Rate()
                   return mtgRate;
              public void calcmonthPymt(double newValue)                            //(LoanAmt * Rate) / (1- Math.pow(1+Rate,-Term));
                     monthPymt = (newValue);
              public void display()
              System.out.println ("The Mortgage Amount is:" +(Amount( ) * Rate( )) / (1- Math.pow(1+Rate( ),-Term( ))));
         public static void main (String[] args)
                     Mortgage Mortgage1=new Mortgage();
                     Mortgage1.Amount(200000);
                     Mortgage1.Term(360);
                     Mortgage1.Rate(.0575);
                     Mortgage1.display();
    }

    I figured it out, the math is wrong I think but I got everything to display correctly
    import java.io.*;
    import java.text.*;
    import java.text.DecimalFormat;
    public class Mortgage
         double mtgAmount;
         double mtgTerm;
         double mtgRate;
         double monthPymt;
         DecimalFormat money = new DecimalFormat("$0.00");
              public void Amount(double newValue)
                     mtgAmount = newValue;
              public double Amount()
                   return mtgAmount;
              public void Term(double newValue)
                     mtgTerm = newValue;
              public double Term()
                   return mtgTerm;
              public void Rate(double newValue)
                     mtgRate = newValue;
              public double Rate()
                   return mtgRate;
              public void calcmonthPymt(double newValue)                            //(LoanAmt * Rate) / (1- Math.pow(1+Rate,-Term));
                     monthPymt = (newValue);
              public void display()
              monthPymt = (Amount( ) * Rate( )) / (1- Math.pow(1+Rate( ),-Term( )));
              System.out.printf("The payment amount is:$%.2f", monthPymt);
              System.out.println();
         public static void main (String[] args)
                     Mortgage Mortgage1=new Mortgage();
                     Mortgage1.Amount(200000);
                     Mortgage1.Term(360);
                     Mortgage1.Rate(.0575);
                     Mortgage1.display();
    }

  • Need help with pagination for book

    I am working on a book and need help with the pagination. I was able to make the TOC and front matter show the numbers as Roman numerals, and the body of the text as Arabic numerals, but I can't figure out how to restart the numbering sequence for the body of the text. So the front matter is numbered i-xvi, and the text is 17-681. I need the text to start with the number 1. Each subsequent chapter is a section break as well, if that makes a difference.
    Many thanks,
    J

    Click on the page that shall start on number one. Open Inspector palette > Layout inspector (2nd tab) >
    Section > Start at: > 1

  • I need help with searching for an image inside another image

    I need to write a program that checks for a specific image (a jpg) inside another, larger, image (a jpg). If so, it returns a value of true. Can anyone help me?
    Winner takes all. First person to solve this gets 10 dukes.
    Please help.

    Hi,
    I would use a full screen image Sequence made with png for transparency and put your article behind. no auto play, stop at first and last image. and information for swipe to display article.

  • Need help with threads?.. please check my approach!!

    Hello frnds,
    I am trying to write a program.. who monitors my external tool.. please check my way of doing it.. as whenever i write programs having thread.. i end up goosy.. :(
    first let me tell.. what I want from program.. I have to start an external tool.. on separate thread.. (as it takes some time).. then it takes some arguments(3 arguments).. from file.. so i read the file.. and have to run tool.. continously.. until there are arguments left.. in file.. or.. user has stopped it by pressing STOP button..
    I have to put a marker in file too.. so that.. if program started again.. file is read from marker postion.. !!
    Hope I make clear.. what am trying to do!!
    My approach is like..
    1. Have two buttons.. START and STOP on Frame..
    START--> pressed
    2. check marker("$" sign.. placed in beginning of file during start).. on file..
         read File from marker.. got 3 arg.. pass it to tool.. and run it.. (on separate thread).. put marker.. (for next reading)
         Step 2.. continously..
    3. STOP--> pressed
         until last thread.. stops.. keep running the tool.. and when last thread stops.. stop reading any more arguments..
    Question is:
    1. Should i read file again and again.. ?.. or read it once after "$" sign.. store data in array.. and once stopped pressed.. read file again.. and put marker ("$" sign) at last read line..
    2. how should i know when my thread has stopped.. so I start tool again??.. am totally confused.. !!
    please modify my approach.. if u find anything odd..
    Thanks a lot in advance
    gervini

    Hello,
    I have no experience with threads or with having more than run "program" in a single java file. All my java files have the same structure. This master.java looks something like this:
    ---master.java---------------------------------------------------
    import java.sql.*;
    import...
    public class Master {
    public static void main(String args []) throws SQLException, IOException {
    //create connection pool here
    while (true) { // start loop here (each loop takes about five minutes)
    // set values of variables
    // select a slave process to run (from a list of slave programs)
    execute selected slave program
    // check for loop exit value
    } // end while loop
    System.out.println("Program Complete");
    } catch (Exception e) {
    System.out.println("Error: " + e);
    } finally {
    if (rSet1 != null)
    try { rSet1.close(); } catch( SQLException ignore ) { /* ignored */ }
    connection.close();
    -------end master.java--------------------------------------------------------
    This master.java program will run continuously for days or weeks, each time through the loop starting another slave process which runs for five minutes to up to an hour, which means there may be ten to twenty of these slave processes running simultaneously.
    I believe threads is the best way to do this, but I don't know where to locate these slave programs: either inside the master.java program or separate slave.java files? I will need help with either method.
    Your help is greatly appreciated. Thank you.
    Logan

  • Need help with CF component call, please

    Hi!
    I've been working with component lately but still learning. In one of my logic I need to use an existing component and I'm not sure how to correctly call the function and get the return result from that.
    Can anyone help me please?
    Basically I created a component:
    <cfcomponent displayname="X">
         <CFFUNCTION name="GetNames">
           <fargument name="1" type="String" required="TRUE">
           <cfargument name="2" type="String" required="TRUE">
           <!---- I do my work here ---->
            within my logic, I need to call an existing function located at
            in a different component And I  need to use the result returned by this function.
            (see below)
            I'm not sure how to correctly call that function from here
            Can I simply do:
            <cfinvoke component="the location of Y component" method="Compare" MyVar = "MyNames" Returnresult="Z">
            <CFIF #Z# NEQ 0>
                <!---  DO something --->
           <CFELSE>
              <!--- do something else --->
           </CFIF>
         </CFFUNCTION>
    </cfcomponent>
    This is the existing componen that I need to use. It's located at the same directory:
    <cfcomponent displayname="Y">
    <!--- assuming this is the function that I need to call --->
         <CFFUNCTION name="Compare" hint="verify names">
           <cfargument name="MyVar" type="String" required="TRUE">
          <cfscript>
                some logic here
                 return return_struct;
         </cfscript>
         </CFFUNCTION>
    </cfcomponent> 
    Please advice, thank you!

    I hopo the following example will be helpful for. Please let me know if you have any questions.
    childComponent.cfc:
    <cfcomponent displayname="childComponent">
        <cffunction name="childComponentFunction" access="remote" returntype="string">
            <cfargument name="myArgument" type="string" required="yes">
            <cfset var finalString="">
            <cfinvoke component="baseComponent" method="baseComponentFunction" returnvariable="finalString">
                <cfinvokeargument name="stringArgumentToReturn" value="#arguments.myArgument#">
            </cfinvoke>
            <cfreturn finalString>
        </cffunction>
    </cfcomponent>
    baseComponent.cfc:
    <cfcomponent displayname="baseComponent">
        <cffunction name="baseComponentFunction" access="public" returntype="string">
            <cfargument name="stringArgumentToReturn" required="yes" type="string">
            <cfreturn arguments.stringArgumentToReturn>
        </cffunction>
    </cfcomponent>
    FYI - There several other methods through which we can call functions of different functions.

Maybe you are looking for