How to add an interval tier to TextGrid(silences) - praat

I would like to ask a very introductory question. I made a textgrid object in Praat using "To TextGrid (silences)." I have selected the sound and the text grid, and pressed "view and edit." Here, I can see just one tier, which shows silence and sounding part. I would like to add to another tier to annotate segmental information. To do so, I have pressed "add interval tier" button in the editor. In this case, I can successfully make another tier. To automate this process, I would like to write a script for this process. Currently, I opened a new script window and pasted the history to the window. The following is the history:
Read from file: "/Users/gen/Desktop/praat/0705/0705.WAV"
Convert to mono
selectObject: "Sound 0705_mono"
To TextGrid (silences): 100, 0, -25, 0.1, 0.1, "silent", "sounding"
selectObject: "Sound 0705_mono"
plusObject: "TextGrid 0705_mono"
View & Edit
Add interval tier: 2, "word"
I have just run this code. However, an error takes place in line 8. Praat said 'Command "Add interval tier:" not available.'
How can I add the interval tier in the textgrid?

Try this:
Read from file: "/Users/gen/Desktop/praat/0705/0705.WAV"
Convert to mono
selectObject: "Sound 0705_mono"
To TextGrid (silences): 100, 0, -25, 0.1, 0.1, "silent", "sounding"
Insert interval tier: 2, "word"
selectObject: "Sound 0705_mono"
plusObject: "TextGrid 0705_mono"
View & Edit

Related

Setting default position of Windows Terminal (Preview)

On opening Windows Terminal (Preview), part of the window is below the taskbar. When I move the application window to a desired position on screen and re-open the application, it is not at the previous position, which I had set by dragging the window.
In the profile.json settings file, there is no option to set the default window location.
How do keep the window position from previous session, as I don't want to drag the window every time I open the application?
Restoring the previous position is not possible yet, but as of https://github.com/microsoft/terminal/releases/tag/v0.6.2951.0 you can set an initial position for new windows:
"initialCols": 120,
"initialRows": 60,
"initialPosition": "2400,500", // x,y
Also see https://devblogs.microsoft.com/commandline/windows-terminal-preview-1910-release/.
If you just want to center the terminal then add the following attribute to your terminal's settings.json:
"centerOnLaunch": true,
refer to microsoft docs: center on launch
If you want specific position then add this code instead:
"initialCols": 120,
"initialRows": 60,
"initialPosition": "2400,500", // x,y

How to adjust window placement with AutoHotkey?

I can run all of my programs with AutoHotkey, but I'm trying to open them all in specific locations on my 3 monitors. I played with some code but couldn't get it to change at all. This is what I have so far for one of my folders that I'm trying to open with this hotkey:
Run, C:\Python\LPTHW
WinActivate
WinMove A,, 10, 10, A_ScreenWidth-20, A_ScreenHeight-20
I got this code partially from another forum and I only kind of understand what it does, but modifying the numbers doesn't change anything about how it opens, and every once in a while it makes all my desktop icons disappear when I run it.
Couple things you should probably know. The A tells WinMove to move the active window. It's best to call out specifically what you're trying to move. And, the Width and Height parameters need to be forced as expressions. Take a look and see if you can alter your code to work based on the notepad example below.
Run, notepad
WinWaitActive, Untitled - Notepad
WinMove, Untitled - Notepad,, 0, 0, % A_ScreenWidth/2, % A_ScreenHeight/2

Is there any software to record and replay mouse movements and clicks with button Id support?

Before I endeavor to develop my own solution to this I am wondering if anyone has stumbled on something like this because my search results have yielded nothing.
I am looking for mouse recording software that will allow me to record clicks on specific apllications but it will keep track of the button ids as well so as to repeat those clicks even if the software launches in a different resolution etc.
Thank you in advance.
Autoit does the first half of what you want. Though since it has scripting ability, I imagine you can get the current resolution and calculate the position for a different one.
Example:
; Double click at the x, y position of 0, 500.
MouseClick($MOUSE_CLICK_LEFT, 0, 500, 2)
As anther poster suggested you can use AutoIt for this. However, you want to use ControlClick to click a button/control so your script won't be dependent on screen resolution. You can find the ID of most controls using the AutoIt Window Information Tool and then just use it with ControlClick. For example:
ControlClick("Window Name", "", 762)
You can also use TEXT, CLASS, CLASSNN, NAME, REGEXPCLASS and X \ Y \ W \ to click a control using ControlClick.

alarm on screen change

I have to use a software which list my clients processes. I need a sound alert program if something change on 50x10 pixel region. I try to write a program on autohotkey but i can't succeed in. Anybody have this program?
Here is an example that you can use.
^Launch_Media:: ; Make a reference screenshot with NirSoft NIRCMD by pressing Ctrl+Media or any other program...
run, "C:\Program Files\1 My Programs\nircmd.exe" savescreenshot "c:\Temp\Screenshot.bmp" 33 40 17 20 ; Location of "Save As" Icon in SciTE4AutoHotKey Editor
Return
Launch_Media:: ; Launch this test manually with Media Button
CoordMode Pixel ; Interprets the coordinates below as relative to the screen rather than the active window.
ImageSearch, FoundX, FoundY, 0, 0, 200, 200, C:\Temp\Screenshot.bmp ; search for image in area staring at 0,0 to 200,200
if ErrorLevel = 2
MsgBox Could not conduct the search.
else if ErrorLevel = 1
MsgBox Image could not be found on the screen.
else
SoundBeep, 1000, 1000
MsgBox The Image was found at %FoundX% %FoundY%.
ClickX:=FoundX + 5 ; Move the mouse click away from the edge of the icon
ClickY:=FoundY + 5 ; Move the mouse click away from the edge of the icon
Click, %ClickX%, %ClickY% ; Click on the Save As icon.
Return
When we know more about what you want to test (I think that an area of 50x10 might be too small), and what you want to do in case the area has changed, we might be able to help you with a more suited script.
In this example I used NirSoft's nircmd.exe, but you can create a reference image by other means as well. If You only need an audible alarm, you can comment all the other commands under if, then, else out with ;.
Did you check this post from 2 years ago in the AutoHotKey community?
http://www.autohotkey.com/board/topic/56219-fast-screen-change-check-using-histograms/
The above script might be a little overwhelming, but you can also create a screenshot of a fixed area and do an image comparison in AutoHotKey as others have done before you.

Can I reduce or minimize the size of a picture in Excel 2007?

Can we minimize a picture/image inserted in Excel, so that we are able to see it only when we click on any button (the way we ungroup or group data in Excel)?
Yes you can, Right click on the picture and click on Assign macro (you can do it on a button as well)
Click on New to create a new macro.
You will get the following code in the VB editor:
Sub Picture1_Click()
End Sub
Add those 3 lines in between to resize to 50%:
Sub Picture1_Click()
ActiveSheet.Shapes.Range(Array("Picture 1")).Select
Selection.ShapeRange.ScaleWidth 0.5, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 0.5, msoFalse, msoScaleFromTopLeft
End Sub
FYI the name of the selected picture is showing before the formula bar.
If you get that, you will be able to do the other way around by searching a bit on how excel macro and vba works.

Resources