Hi guys, sorry for the delay, I had a computer issue, could not get my mac working for 2 weeks, but now it's working well again 
@Sleepy
Is each sentence on a unique line containing no newline characters? Or can a sentence span multiple lines?
Yes each sentence is on a unique line. I'm using this script to randomize the choice of a sentence within a list:
I've never heard the word "profile" used in a KM discussion before so can you clarify what you mean by that? Do you mean calling macro?
For an experiment, I'm trying to automatize interactions between several profiles / accounts of a social media. In that sense, my macro is set like this : connection to profile 1 > post a random sentence > quit internet browser > connection to profile 2 > post a random sentence. To do so, my macros are structured as follow:
Macro named Time 1
1 - Run macro "Connection to profile 1"
2 - Run macro "Post a sentence"
3 - Run macro "Connection to profile 2"
4 - Run macro "Post a sentence"
5 - Run macro "Connection to profile 3"
6 - Run macro "Post a sentence"
...
Is there just one set of sentences, or does each calling macro have its own set?
Yes there is only one set of sentences as some sentences may contain variables.
Are you worried about duplicates from two different macros which call this routine - can they end up using the same sentence, or is each sentence usable only once no matter who calls it?
Indeed, each sentence should be usable only once, no matter which profiles use it.
And what happens when you run out of sentences, do you want to start over?
I already have 60 variations of sentences, so I cannot run out of sentences as the macro is only run once.
Moreover, I've tried to set a variable and use it in the shell script I've added above but it does not work. How can I use a variable within a sentence which is part of the list in the shell script ?
Thanks a lot for your help 