ikodan Posted October 8, 2015 Report Share Posted October 8, 2015 Hello, I just bought your pro version (N.B from France), excellent tool. I have two problems : 1st : I have a list in clipboard : Maggie Yubie Ned Rufus Lily I wan't to put each line in a variable (Maggie to T1, Yubie to T2...) but I don't find how to do it... 2nd : I have a second list : Rufus Maggie Yubie Tata Ned Toto Titi Lily I wan't to save in variables, only the names of the first list, but in the order of the second list ? Can someone help me please ? Quote Link to comment Share on other sites More sharing options...
rberq Posted October 8, 2015 Report Share Posted October 8, 2015 We need something to distinguish one word (name?) from the next. Where did the list in the clipboard come from? Is there anything that separates the end of one name from the beginning of the next -- Carriage Return or New Line characters? Maybe just capitalization at the beginning of each name? Quote Link to comment Share on other sites More sharing options...
Look_Up Posted October 8, 2015 Report Share Posted October 8, 2015 (edited) You can help youself by try it out. But anyway... Every beginning is difficultYou can download the full macro at the end of post - see attachment Variable Set to ASCII Char 13 to %T[97]% // Save "Carriage Return" in string variable %T[97]% Variable Set to ASCII Char 10 to %T[98]% // Save "Line Feed" in string variable %T[98]% // merge both variable %T[97]% and %T[98]% to %new_line% trigger the same behave like pressing < Enter > on keyboard Variable Set String %new_line% to "%T[97]%%T[98]%" // Save all content in string variable %full_uncut_content_clipboard% Variable Set String %full_uncut_content_clipboard% from the clipboard contents // Now, the content from clipboard is in string variable %full_uncut_content_clipboard% but how we get it into T[x] variable ? // With "Split String" ... (Variables - Split String) Split String "%full_uncut_content_clipboard%" on "%new_line%" into %T%, starting at 1 // We say: Split String %full_uncut_content_clipboard% on every end of line %new_line% // And put them into %T% variable beginning with %T[1]% continue with %T[2]%, %T[3]% untill all data is split // Now you can do the 2nd job Variable Set String %T[20]% to "Tata" Variable Set String %T[21]% to "Toto" Variable Set String %T[22]% to "Titi" // Now we bring it into the correct order // Remeber: %T[1]% = Maggie %T[2]% = Yubie %T[3]% = Ned %T[4]% = Rufu %T[5]% = Lily Text Box Display: Show all Names You learn faster when you try out some thinks. So see this is a special case.Welcome to Macro Express ProLook_Up Save content from clipboard.mex Edited October 8, 2015 by Look_Up Quote Link to comment Share on other sites More sharing options...
Cory Posted October 8, 2015 Report Share Posted October 8, 2015 I too split on CRLF. I encourage you to get away from "T" variables. That's an ME3 limitation. Make your own arrays with sensible designations like %Name[1]% Quote Link to comment Share on other sites More sharing options...
ikodan Posted October 8, 2015 Author Report Share Posted October 8, 2015 Hello, I'm not a begginer, I done a lot of very stable macros, but for this problem, I just don't know how to do. :/ rberq I tried pixels etc... Wrong way. Look_Up Wow, interesting way ! I try to understand, thank you ! Cory What is CRLF ? I don't understand. Quote Link to comment Share on other sites More sharing options...
ikodan Posted October 8, 2015 Author Report Share Posted October 8, 2015 You can help youself by try it out. But anyway... Every beginning is difficult You can download the full macro at the end of post - see attachment Variable Set to ASCII Char 13 to %T[97]% // Save "Carriage Return" in string variable %T[97]% Variable Set to ASCII Char 10 to %T[98]% // Save "Line Feed" in string variable %T[98]% // merge both variable %T[97]% and %T[98]% to %new_line% trigger the same behave like pressing < Enter > on keyboard Variable Set String %new_line% to "%T[97]%%T[98]%" // Save all content in string variable %full_uncut_content_clipboard% Variable Set String %full_uncut_content_clipboard% from the clipboard contents // Now, the content from clipboard is in string variable %full_uncut_content_clipboard% but how we get it into T[x] variable ? // With "Split String" ... (Variables - Split String) Split String "%full_uncut_content_clipboard%" on "%new_line%" into %T%, starting at 1 // We say: Split String %full_uncut_content_clipboard% on every end of line %new_line% // And put them into %T% variable beginning with %T[1]% continue with %T[2]%, %T[3]% untill all data is split // Now you can do the 2nd job Variable Set String %T[20]% to "Tata" Variable Set String %T[21]% to "Toto" Variable Set String %T[22]% to "Titi" // Now we bring it into the correct order // Remeber: %T[1]% = Maggie %T[2]% = Yubie %T[3]% = Ned %T[4]% = Rufu %T[5]% = Lily Text Box Display: Show all Names You learn faster when you try out some thinks. So see this is a special case. Welcome to Macro Express Pro Look_Up Hi again, Your script is not dynamic. I want it to saves the name list in the order of the clipboard, and not with a previously defined order. And the lines to remove "Tata Titi Toto" can be other ; I want the script deletes all the names that are not in the first list. I search because it's funny, but I think I will not find alone. I learnt <SPLIT STRING Source="%full_uncut_content_clipboard%" SplitChar="%new_line%" Dest="%T%" Index="1"/> It's very good. Now I just need a function to keep only the names in bold, before putting them in T variables (because I need them to be in T1 T2 T3 etc. and not T1 T4 T5 T7 for exemple) : Rufus Maggie Yubie Tata Ned Toto Titi {other random lines} Lily Quote Link to comment Share on other sites More sharing options...
ikodan Posted October 9, 2015 Author Report Share Posted October 9, 2015 I found ! I eliminate the names that I wan't to keep, and put the others into variables, and I start again but this time I remove the new variables on the full name list, it works so I put them in variables that I export for my other macro. Quote Link to comment Share on other sites More sharing options...
ikodan Posted October 9, 2015 Author Report Share Posted October 9, 2015 Thank you ! Quote Link to comment Share on other sites More sharing options...
Look_Up Posted October 9, 2015 Report Share Posted October 9, 2015 Please STOP FULL QUOTE from my post !!! Whatever you want to try... Now you know how to get content from clipboard to a variable. Try thinking yourself. You can create your own variables and copy one value to another with "Variable modify string" (Copy Whole Text) In other case you should tell me exactly what you want to do. Is the second list also in clipboard ? In which order do you want sort the list ? Which person has a higher priority ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.