Share info between two files ?

hello, is it possible to collect automatically information of 1 cell of 1 file into a cell of another file ?
tx for your help
s

Hello
I enhanced the script.
(1) corrected some errors
(2) add the ability to use a special kind of references into the source document.
Footer colNum may be used to grab the bottom cell in the column colNum.
The beast is available on my iDisk with sample files.
<http://idisk.me.com/koenigyvan-Public?view=web>
Download:
For_iWork:iWork '09:for_Numbers09:fromDoc#1toDoc#2.dmg.zip
--[SCRIPT fromDoc#1toDoc#2]
Enregistrer le script en tant que Script, Application ou Progiciel : fromDoc#1toDoc#2.xxx
déplacer l’application créée dans le dossier
<VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:Numbers:
Il vous faudra peut-être créer le dossier Numbers et peut-être même le dossier Applications.
menu Scripts > Numbers > fromDoc#1toDoc#2
Naviguer pour choisir un document texte contenant les paramètres décrivant le traitement à effectuer.
En fonction de ces paramètres, le script ouvrira deux documents Numbers et copieradans le second des valeurs prélevées dans le premier.
Voici un exemple de fichier texte des paramètres:
Macintosh HD:Users:yvan_koenig:Desktop:
Source.numbers
Feuille 1
Tableau 1
Macintosh HD:Users:yvan_koenig:Desktop:
Destination.numbers
Feuille 18
Tableau 12
4
D4
E4
D8
E8
D4
E4
D8
E8
ligne1 contient le chemin d'accès au dossier contenant le document source
ligne2 contient le nom du document source
ligne3 contient le nom de la feuille source
ligne4 contient le nom de la table source
ligne5 contient le chemin d'accès au dossier contenant le document destination
ligne6 contient le nom du document destination
ligne7 contient le nom de la feuille destination
ligne8 contient le nom de la table destination
ligne9 contient le nombre de valeurs à extraire/insérer
viennent ensuite les références des cellules sources
suivies des références des cellules destination
Pied de page numéroDeColonne peut être utilisé pour référencer la cellule la plus basse de la colonne numéroDeColonne.
--=====
L'aide du Finder explique:
L'Utilitaire AppleScript permet d'activer le Menu des scripts :
Ouvrez l'Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
Cochez la case "Afficher le menu des scripts dans la barre de menus".
=+=+=+=+=+=+=+=
Save the script as a Script, an Application or an Application Bundle: fromDoc#1toDoc#2.xxx
Move the newly created application into the folder:
<startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:
Maybe you would have to create the folder Numbers and even the folder Applications by yourself.
menu Scripts > Numbers > fromDoc#1toDoc#2
Navigate to choose a text document containing the parameters describing the operations to execute.
Give these parameters, the script will open two Numbers documents and copy in the second one a set of values grabbed from the first one.
Here is a sample of the parameters text file:
Macintosh HD:Users:yvan_koenig:Desktop:
Source.numbers
Feuille 1
Tableau 1
Macintosh HD:Users:yvan_koenig:Desktop:
Destination.numbers
Feuille 18
Tableau 12
4
D4
E4
D8
E8
D4
E4
D8
E8
line1 is the path to the folder containing the source document
line2 is the name of the source document
line3 is the name of the source sheet
line4 is the name of the source table
line5 is the path to the folder containing the destination document
line6 is the name of the destination document
line7 is the name of the destination sheet
line8 is the name of the destination table
line9 is the number of values to grab/insert
then are the references of the source cells
then are the references to the destination cells
Footer colNum may be used as a reference to the bottom cell of the column colnum.
You may use the word 'Footer' or it's localized version ('Pied de page' for instance)
--=====
The Finder's Help explains:
To make the Script menu appear:
Open the AppleScript utility located in Applications/AppleScript.
Select the "Show Script Menu in menu bar" checkbox.
+++++++
Yvan KOENIG (Vallauris FRANCE)
23 avril 2009
24 avril 2009
on run
if my parleAnglais() then
set leFichier to choose file with prompt "Select the parameters text file…" of type {"public.plain-text"}
else
set leFichier to choose file with prompt "Choisir un fichier texte contenant les paramètres …" of type {"public.plain-text"}
end if
Ugly workaround to grab the localized string "Footer"
In Numbers it's available in a .nib file in which we can't enter.
set p2lproj to (path to applications folder as text) & "iWork '09:Pages.app:Contents:Resources:Templates:Woodland Resume.template:Contents:Resources:"
tell application "Pages" to set FOOTER_loc to localized string "STYLE_Footer" from table "Localizable" in bundle file p2lproj
try
set enTexte to paragraphs of (read leFichier from 1)
set p2source to item 1 of enTexte
set document1 to item 2 of enTexte
set sheetSource to item 3 of enTexte
set tableSource to item 4 of enTexte
set pDocument1 to p2source & document1
set p2dest to item 5 of enTexte
set document2 to item 6 of enTexte
set sheetDest to item 7 of enTexte
set tableDest to item 8 of enTexte
set pDocument2 to p2dest & document2
set nbRefs to item 9 of enTexte
set listeSource to items 10 thru (10 - 1 + nbRefs) of enTexte
set listeDestination to items (10 + nbRefs) thru (10 - 1 + nbRefs + nbRefs) of enTexte
on error
if my parleAnglais() then
error "The text file doesn‘t match the script‘s requirements !"
else
error "Le fichier texte ne respecte pas" & return & "les exigences du script !"
end if
end try
tell application "Numbers"
open pDocument1
open pDocument2
grab every wanted values from the source document
tell document document1 to tell sheet sheetSource to tell table tableSource
set listeValues to {}
repeat with aRef in listeSource
if (aRef starts with FOOTER_loc) or (aRef starts with "footer") then
copy value of cell (count of rows) of column ((last word of aRef) as integer) to end of listeValues
else
copy value of cell aRef to end of listeValues
end if
end repeat
end tell -- document1
Insert the grabbed values in the destination document
tell document document2 to tell sheet sheetDest to tell table tableDest
repeat with i from 1 to count of listeDestination
set value of cell (item i of listeDestination) to item i of listeValues
end repeat
end tell -- document2
save document document1
save document document2
You may disable these two 'closing' lines if you wish to keep the documents open.
It may be useful if you make changes in the source document and share them with the destination one.
--close document document1 without saving
--close document document2 without saving
end tell -- Numbers
end run
--=====
on parleAnglais()
local z
try
tell application "Numbers" to set z to localized string "Cancel"
on error
set z to "Cancel"
end try
return (z is not "Annuler")
end parleAnglais
--=====
--[/SCRIPT]
Yvan KOENIG (from FRANCE vendredi 24 avril 2009 11:08:30)

Similar Messages

  • Share code between two files/classes

    Hey,
    in my AppDelegate.m I have a UITextField, in another ViewController.m I want to display an alert if the UITextField has a special text.
    How can I share this code, or how can I reach the TextField.text in my other ViewController?
    Thanks for help!

    I think the easiest way to do it might be to use NSNotificationCenter. I'm not sure if I understand your problem right, but if it's what I think it is, in your AppController, add the following code whenever the text field is updated:
    /*You must have the string for your text field in a variable named textString.
    If you are calling it something different, you can change what the variable name
    is in the second line of the code with the NSDictionary.*/
    NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
    NSDictionary *info = [NSDictionary dictionaryWithObject:textString forKey:@"text"];
    [notificationCenter postNotificationName:@"TextFieldChanged" object:self userInfo:info];
    Then, in your view, add this to your init method:
    NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
    [notificationCenter addObserver:self
    selector:@selector(textFieldChanged:)
    name:@"TextFieldChanged"
    object:nil];
    Now, you have to implement the textFieldChanged: method in your view controller like this:
    -(void)textFieldChanged:(NSNotification *)notification {
    NSLog(@"Received notification.");
    NSString *string = [[notification userInfo] objectForKey:@"text"];
    //Your code to display an alert.
    I hope that helps.

  • How do I share music between two accounts on the same i-mac

    How do I share music between two accounts on the same i-mac

    iTunes: How to share music between different accounts on a single computer - http://support.apple.com/kb/HT1203 - relocating iTunes' media folder to a shared area but leaving separate library files - extra tip at https://discussions.apple.com/message/17331189

  • How can I share data between two forms on different lists

    Using a custom content type, I created two lists that I want to share the same data - one is a calendar.  Our employees complete a form from the "Out of Office Request" list that has workflow functionality that sends an email to that person's
    manager.  If the manager approves the request, the item automatically populates the "Out of Office Calendar."  The problem is that the only information from the request list that populates the calendar is the Title field and date/time fields. 
    I need the manager name in order to create a view for each manager.  
    How can I connect the other information in the request list to the calendar list.  It seems to me that if the title and date fields carry over the information, there should be a way to connect the other information.  I'm using Designer.
    I've tried to connect the two lists' webparts with the wizard, but when I get to the page that maps the two lists, there are no column names and the "Next >" button is grayed out.  This seems like the logical place to connect the two lists,
    but it isn't working.

    Hi,
    According to your post, my understanding is that you wanted share data between two forms on different lists.
    To show external  information on the calendar event, there are two methods: Calculated column, workflow. You can refer to:
    A Simple Guide to Show More Information on a Calendar Event
    I recommend to use workflow to achieve what you want. But you need to create a people column to display the manager.
    You can create a workflow associated to the "Out of Office Request" list, add action to Start Approve Process. If the manager approves the request, you can create a item in the calendar, and then update the people column and the title column.
    Then the calendar will display the Title, date/time and the manager.
    To create a view for each manager, you need to modify the Filter. You can use the people column is equal to the manager name or the Title contains the manager name.
    Thank you for your understanding.
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • How can I share calendars between two different people?

    I am trying to share my ICAL with my wife and she wants to do the same with me. For some reason I cannot find the path to allow us to see each otjer's calendars. Any ideas?
    Thanks
    Don

    Hi,
    According to your post, my understanding is that you wanted share data between two forms on different lists.
    To show external  information on the calendar event, there are two methods: Calculated column, workflow. You can refer to:
    A Simple Guide to Show More Information on a Calendar Event
    I recommend to use workflow to achieve what you want. But you need to create a people column to display the manager.
    You can create a workflow associated to the "Out of Office Request" list, add action to Start Approve Process. If the manager approves the request, you can create a item in the calendar, and then update the people column and the title column.
    Then the calendar will display the Title, date/time and the manager.
    To create a view for each manager, you need to modify the Filter. You can use the people column is equal to the manager name or the Title contains the manager name.
    Thank you for your understanding.
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Share bandwidth between two subinterface

    dears
    I have 2 subinterface (f0/1.100 & f0/1.101)
    and i have 10 Mb BW
    how to share bandwidth between two subinterface ???

    How do you want to share the bandwidth?
    What device and IOS version?

  • I want to share info between my iPad and iPhone only but share apps with my spouse. How do I configure that?

    I want to share info between my iPad and iPhone only but still share apps with my spouse. How do I configure that?

    Need some more info - what info do you want to share?

  • Is there any way to share music between two iPhones ?

    I want to share music between two iPhones with different apple IDs , isn't there any method to do that without itunes ?

    In general, the catalog that is open when you do Export As Catalog is where the settings are, and the catalog that is open when you do Import From Catalog is where the settings aren't, yet, but will be after the Import.  Your assumptions appear to be correct for your particular example.

  • Difference between two files

    Hi, I need to find difference between two files.
    This is an example:
    oldfile.txt:
    This is the old file.
    I need some help with
    this task!.
    newfile.txt:
    This is the new file.
    I need help with this task please!.
    Differences:
    * old -> new
    * need -> need
    * "some" was deleted
    * please was added
    Notice that I don't care spaces, new lines or tabs.
    The code should looks like:
    enum DifferenceType { Added, Deleted, Replaced };
    class DiffText {
      public String Text;
      public DifferenceType Type;
      public String ReplacedText;
      Diff d = new Diff("oldfile.txt","newfile.txt");
      while(!d.end()) {
        DiffText dtext = d.getNext();
       String s = "";
        switch(s.Type) {
          case Added:       System.out.println(s.Text + " ~ added");
          case Deleted:    System.out.println(s.Text + " ~ deleted");
          case Replaced: System.out.println(s.Text + " replaced by " + s.ReplacedText);
      }Thanks for your help in advance.

    Suppose you have two arrays filled with integers.
    What you want to do is map the integers from one
    array to the other.
    In your example, your arrays would look like:
    this is the old file i need some help with this task
    [0 1 2 3 4 5 6 7 8 9 0 10]
    this is the new file i need help with this task please
    [0 1 2 11 4 5 6 8 9 0 10 12]
    Here, I've assumed you've removed all punctuation and
    new line characters, and changed to lowercase.
    The easiest way is to walk through the arrays greedily.
    However, you may be able to research algorithms that
    do a better job of matching.

  • How to share documents between two macs,

    I NEED TO SHARE documents between two macs....keynote dcts.....and I always want to be working with the last dct, what is the esiest and safer way to do it ?

    Ok I have three macs sharing mobile me. One at work that´s a imac,at home my old Mack book Pro with a big monitor and now I got a beautiful Mac Book Air.
    The two computers at home can be connected wireless,I have a time capsule disk that at this moment is only backing up my MBPro. I will use my MBA for everyday use,mails,navigating and for lecturing....with keynote. Basically the documents that I need to share daily will be keynote dcts. And may be some apperture projects.
    All the mails calendars etc work beautiful with mobileme.
    I don´t really need to conect the imac at work.
    Any ideas to make things easy?
    If I work only wit dcts does are about 400 KB. If I use my folder of preentations is about 42 GB, I think I just need to work with dcts....

  • How do I share info between my two computers over my network?

    Hello !
    I have an iMac, my husband has a Macbook. I just recently got an AEBS so that we could share the internet in the house. We are both wirelessy connected (thanks to the help on this forum). But I am wondering HOW can I share info on my computer...with his macbook? On HIS computer I can see a "shared" option on his HD, and my iMac is listed. It asks for password to access it. But I never set up this sort of sharing. I tried looking around on the iMac last night to figure out where I would do this, but to no avail. And I'm afraid to do something in fear of messing something else up !
    I guess I have no idea how this "networking" thing really works. Any help would be appreciated !
    Thanks for your help in advance.
    Christine

    +Ok...so I went to the system pref/account tab. and I see where the password is for my iMac. Is that the password he would use to access the computer from his? the same one I use to access my own computer?+
    Yes, correct. When he "logs on" to your computer from his, he will be given the option for KeyChain access on his computer to "remember" the password so he won't have to manually enter the password each time he connects to your computer.
    Same thing in reverse when you connect to his.
    In most cases, the only thing you really need to share are the "printer" and "files", but you have a number of other options as well.

  • TS2972 How can I share playlists between two users on the same laptop?

    I have a work account and a home account on my laptop in Windows 7.  After the new version of iTunes was released this week, I"m unable to share playlists between the two accounts.  HELP.

    iTunes: How to share music between different accounts on a single computer - http://support.apple.com/kb/HT1203 - relocating iTunes' media folder to a shared area but leaving separate library files - extra tip at https://discussions.apple.com/message/17331189

  • API for tools that show differences  between two file in applet

    I am searching Api for tools that show differences between two data file
    that represent as bytes[] in the memory in applet .
    the applet is not sign Applet.

    I gotta it.
    File f=new File("\\\\"+"Linshuaibing"+"\\card\\DSC00134.jpg");[Thank you very much v!

  • Can i share music between two iTunes accounts on the same computer

    I know you can share the library with 'home share', but can you copy the titles to the account sothey can be loaded on to an ipod / iphone?
    Or have i got to load any required music on to the computer a second time?

    This should help:
    iTunes: How to share music between different accounts on a single computer
    Note that when it says "publicly accessible location", it needs to be a place where everyone has read and write access. The most common such place is the Shared folder in the Users folder, but you can place the music elsewhere if you change the access permissions manually (don't start tinkering with permissions unless you're confident you know what you're doing and can reverse things if they get messed up). 
    Regards.

  • How do i share music between two iphone 4s , but not downloaded apps ?

    i am trying to sync mine & my partners phones so that we can share itunes between both phones, i have set up 1 itunes account (using my apple id) & we each have a icloud account, i have managed to get the music to appear on both phones but it also brought all of my apps onto my partners phone, i think this must be because the itune account is in my apple id, is there a way to share music only ?
    Also to play all the music that is on itunes library on the computer, on my partners phone, you have to change his shared music library setting everytime you wish to see all that is on the itunes account, is this correct?
    hope you can help,

    make 2 user accounts on the computer
    move the music to a folder shared between the 2 accounts
    add the music to itunes on each user account
    sync
    and thats it

Maybe you are looking for

  • TS1424 It refuses my Payment type(s) or it also continues to bill me for items I Nevet Bought! It ( error MSG)

    Hi, Recently & for an ongoing time( not daily! But on & off(?) I'm not sure(?) so odd! I've had Apple Iphone4, iPhone 4S( which was having terrible problems!( 2 wks or sp, I took to my local Apple Store( PPMall location. Providence, RI 02903. Just No

  • Stuck while installation of oracle in linux

    Hi guru's i am stuck with a problem while installation of oracle in linux please help me i am getting following error   [root@localhost etc]# groupadd oinstall groupadd: group oinstall exists [root@localhost etc]# useradd -m -g oinstall-G dba-d/home/

  • Pro*C unconsistency handling create table

    Hi, I'm using Pro*C to connect to database and to execute a series of creating table commands from a C++ program on a Sun Solaris. Sometime the tables are created and sometime they are not, some other times only some of the tables are created. I susp

  • Main table vs Look up Table in MDM 7.1

    Hi All,         I was looking at major differences between Main table and flat table.My question is what stops me from using my lookuptable as the main table as I can do Syndication,key mapping etc even with my flat tables.(Unless I am wrong in my as

  • POIT for production order

    Hello, in our producton enviroment one of our user encounter weird IDOC outcome, all are ok with our set-up in partner profile etc with legards with this process. when he do POIT to transfer the created production order from SAP to other system we en