Previous 1 2 3 4 5 6 Next 79 Replies Latest reply: Feb 6, 2015 2:46 PM by SGIII Go to original post
  • SGIII Level 5 Level 5 (6,845 points)

    carrying around the name of a suburb of London, and one that has the unenviable reputation of being the most racist...  

     

    Sounds like an unhappy place these days.  But a fine old name. Tell 'em it's Eltham as in John of Eltham, or the Eltham ordinances, not that Eltham.

     

    SG

  • hplovejet Level 1 Level 1 (0 points)

    Thanks SGIII

    Can't believe how well that works.

    Took me a while to work out you select origin text before services, then it works like a dream, so much so I created my first screencast - without sound I'm afraid http://youtu.be/A9spe0-Z1Wg

    Tom

  • SGIII Level 5 Level 5 (6,845 points)

    Hi Tom,

     

    Nice to see the demo of what I call the 'Copy Transpose' script in action!  You may have noticed you can share it as a "self-installing" service by choosing the .workflow package in Finder, right-clicking, and and choosing Compress....   The recipient just has to double-click the .zip package and it will move itself to the Library > Services folder so that it appears in the Services menu. (The recipient may have to click 'download anyway' in System Preferences > Privacy & Security).

     

    SG

  • hplovejet Level 1 Level 1 (0 points)

    Awesome I wish I knew others who share this problem so I could send this to them, but assume the Numbers "community" would be delighted to be able to simply download such a service. I assume this forum doesn't permit hosting such files, but I would be happy to do so unless anyone can suggest a better alternative.

     

    I think I forgot to thank you for sharing this, so thanks very much!

    Tom

  • SGIII Level 5 Level 5 (6,845 points)

    You can grab a copy of a self-installing 'Copy Transpose' Automator Service here (Dropbox download).  Feel free to share as you see fit.

     

    SG

  • hplovejet Level 1 Level 1 (0 points)

    That's perfect, thanks SGIII

  • diegoumich Level 1 Level 1 (0 points)

    Hi SGIII,

    Please I need your help, I have tried to run the script but I get the following message:

    "Syntax Error

    Expected end of line but found class name."

     

    And "sheet" at the end of the second line of the script is highlighted. Could you help me figure out what is going on?

     

    Thanks in advance,

    Diego

  • SGIII Level 5 Level 5 (6,845 points)

    Hi Diego,

     

    Make sure you are running Numbers 3 without Numbers 2 open at the same time.

     

    If you still get an error then try copying and pasting the script into AppleScript Editor.

    Or you could try using the service you can download via the link upthread.

     

    SG

  • SGIII Level 5 Level 5 (6,845 points)

    One other thought.  If you're using Numbers  2 and not Numbers 3, then the script should work if you replace this line:

     

    tell application "Numbers" to tell front document to tell active sheet

     

    With this:

     

    tell application "Numbers" to tell front document to tell (first sheet whose every table's selection range's class contains range)

     

    SG

  • Lucyblade Level 1 Level 1 (0 points)

    Hi SGIII,

     

    I think I'm missing something on this. I'm using Numbers 3.2 but everytime I select a range and then select the workflow I get an error message saying:

     

    "Select a range first and then try again"

     

    Is there something special I need to do when selecting a range ?

     

    Hope you can help

     

    Thanks in advance

     

    Natalie

  • Lucyblade Level 1 Level 1 (0 points)

    Ok I solved it, well it's working now anyway !!

     

    For some bizarre reason after I had quit numbers and re-opened the same file it is all now working, so thank you again SGIII your workflow has saved me from lots of tedious data entry.

     

    Thanks

  • SGIII Level 5 Level 5 (6,845 points)

    Hi Natalie,

     

    Great to hear it's working now! One thing that's easy to forget is that only one version of Numbers should be open at the time you run the script.  Also some utility-type applications that jazz up your clipboard (CopyClip, Command-C, CommandClip, and probably dozens or hundreds of others) can get in the way.

     

    SG

  • Thor Klamet Level 1 Level 1 (0 points)

    Your fix for getting it to work in Numbers 2 didn't quite work. Here's the version that worked in Numbers 2:

     

    --Transpose - select range, run, paste transposed values where wanted

    try

        tell application "Numbers" to tell front document to tell (first sheet whose every table's selection range's class contains range)

            set selected_table to first table whose class of selection range is range

            tell selected_table

                set first_col to the address of the first column of the selection range

                set last_col to address of last column of the selection range

                set first_row to address of first row of the selection range

                set last_row to address of last row of the selection range

                set str to ""

                repeat with i from first_col to last_col

                    repeat with j from first_row to last_row

                        set str to str & (value of cell j of column i of selected_table) & tab

                    end repeat

                    set str to str & return -- add line return after row

                end repeat

            end tell

        end tell

        set the clipboard to str

    on error

        display dialog "Select a range first and then try again"

    end try

    --end script

     

    It didn't seem to like assigning the variable my_selection to be the "selection range." Maybe it has to be declared in some way. I just dispensed with the assignment and it worked. Thanks, this will save some time in creating a mailing list using Numbers.

     

    "She who knows not and knows not that she knows not is a fool, spurn her. She who knows not and knows that she knows not is a child, teach her. She who knows and knows not that she knows is asleep, wake her. She who knows and knows that she knows is a fanatic, kill her." -- ancient proverb

  • SGIII Level 5 Level 5 (6,845 points)

    Glad you were able to get it to work in Numbers 2.

     

    SG

  • Danielobix Level 1 Level 1 (0 points)

    Dude, thanks, first time I use automator and this is the only way I could solve this... thumbs up!