Error in Script???


Ipsum.lorem@...
 

Dear community,

I have a weird problem:

My perfectly written script (thanks to Daniel Hirst) works perfectly well on my computer, it does not so on my friend's.

I had a Praat Version from September 22, hers is from February 23 - so I updated mine and it still works.
She saved it unter ".praat" and it is exactly the same as mine (thought maybe it was due to a default font but no)
She has windows, I have a Mac - does that make a difference?

Any idea, where this might be coming from?

Thanks
Loremi


The Script

# Praat script: Get pause durations

# version: 2022-09-10

# - get mean duration of pauses 

# - not counting initial or final pause

# author: Daniel Hirst <djhirst@...>

 

tier = 1

pause_label$ = "silent"

nIntervals = Get number of intervals: 1

nPauses= 0

sumPauses = 0

clearinfo

appendInfoLine: "pause", tab$, "duration"

 

for iInterval from 2 to nIntervals-1

label$ = Get label of interval: tier, iInterval

if label$ = pause_label$

nPauses += 1

start = Get start time of interval:  tier, iInterval

end = Get end time of interval:  tier, iInterval

duration = end - start

sumPauses += duration 

appendInfoLine: nPauses, tab$, fixed$(duration, 3)

endif

endfor

 

meanPause = sumPauses/nPauses

appendInfoLine: "number of pauses: ", nPauses, "; mean duration: ", fixed$(meanPause, 3)


Boersma Paul
 

dear Loremi,

thanks for sending us your script. It looks correct (at first sight).

Next, the most important information for people like me who want to solve the problem would be:

- what exactly did you do before you chose Run? (i.e. I presume you selected a TextGrid object; which one exactly? can you send it along?)

- what did you expect to happen after you chose Run? (e.g. what happened on the Mac?)

- what happened instead? (e.g. "nothing", or "the following text in the Info window", or "the following precise error message")

In as much detail as you can afford...

(and the name of the script wasn't actually ".praat", I presume)

best wishes,
Paul

On 22 Feb 2023, at 12:43, Ipsum.lorem via groups.io <Ipsum.lorem@...> wrote:

Dear community,

I have a weird problem:

My perfectly written script (thanks to Daniel Hirst) works perfectly well on my computer, it does not so on my friend's.

I had a Praat Version from September 22, hers is from February 23 - so I updated mine and it still works.
She saved it unter ".praat" and it is exactly the same as mine (thought maybe it was due to a default font but no)
She has windows, I have a Mac - does that make a difference?

Any idea, where this might be coming from?

Thanks
Loremi


The Script

# Praat script: Get pause durations

# version: 2022-09-10

# - get mean duration of pauses 

# - not counting initial or final pause

# author: Daniel Hirst <djhirst@...>

 

tier = 1

pause_label$ = "silent"

nIntervals = Get number of intervals: 1

nPauses= 0

sumPauses = 0

clearinfo

appendInfoLine: "pause", tab$, "duration"

 

for iInterval from 2 to nIntervals-1

label$ = Get label of interval: tier, iInterval

if label$ = pause_label$

nPauses += 1

start = Get start time of interval:  tier, iInterval

end = Get end time of interval:  tier, iInterval

duration = end - start

sumPauses += duration 

appendInfoLine: nPauses, tab$, fixed$(duration, 3)

endif

endfor

 

meanPause = sumPauses/nPauses

appendInfoLine: "number of pauses: ", nPauses, "; mean duration: ", fixed$(meanPause, 3)


_____

Paul Boersma
Professor of Phonetic Sciences
University of Amsterdam
Spuistraat 134, room 632
1012VB Amsterdam, The Netherlands
http://www.fon.hum.uva.nl/paul/


Ipsum.lorem@...
 

Hi Paul,

 
- what exactly did you do before you chose Run? (i.e. I presume you selected a TextGrid object; which one exactly? can you send it along?)

She did select textgrid object before (see attachment). I sent her my textgrid, she also created a new on herself - both didn't work.
 

- what did you expect to happen after you chose Run? (e.g. what happened on the Mac?)

the script was run and gave me this (Mac)


pause duration

1 0.968

2 0.302

3 0.509

4 0.358

5 1.036

6 0.624

7 0.591

8 1.311

9 0.476

10 0.351

11 0.688

12 0.512

13 1.267

14 0.430

15 0.797

16 0.625

17 0.608

18 0.640

19 1.413

20 0.384

21 1.252

22 0.200

23 0.479

24 0.999

25 0.636

26 0.436

27 1.285

28 0.576

29 0.693

30 0.608

31 0.396

number of pauses: 31; mean duration: 0.692

 
 
- what happened instead? (e.g. "nothing", or "the following text in the Info window", or "the following precise error message")

Windows: my friend got an error message, which I don't recall completely: something with line 7(or 8) not being executed/run completely. I will find out!


Thanks!

Loremi


Ipsum.lorem@...
 

She called the script "pause.praat" :)