terminates when setting bounds with applescript
Thanks for filing an issue! Please answer the questions below so I can help you.
- iTerm2 version: 3.0.13
- OS version: macOS 10.12.3 beta[com.googlecode.iterm2.plist]
- Attach ~/Library/Preferences/com.googlecode.iterm2.plist here (drag-drop from finder into this window)here
- Attach a debug log, if possible. Instructions at https://iterm2.com/debuglog debuglog.txt
- Are you reporting a performance issue or a hang? Please attach a sample. Instructions at https://gitlab.com/gnachman/iterm2/wikis/HowToSample
- Are you reporting a crash? Please attach the crash log. Instructions at https://gitlab.com/gnachman/iterm2/wikis/crash-logs
Detailed steps to reproduce the problem:
- somehow create a window with applescript (tell application "iTerm2" to open ...) or newwindow
- set size / position / bounds
- terminates and rings a bell?
on run {input, parameters}
set xV to 553
set yV to 789
set tV to 100
set bV to 23
set AppleScript's text item delimiters to ";"
tell application "Finder"
set res to bounds of window of desktop
end tell
set {width, height, scale} to words of (do shell script "system_profiler SPDisplaysDataType | awk '/Built-In: Yes/{found=1} /Resolution/{width=$2; height=$4} /Retina/{scale=($2 == \"Yes\" ? 2 : 1)} /^ {8}[^ ]+/{if(found) {exit}; scale=1} END{printf \"%d %d %d\\n\", width, height, scale}'")
set width to width
set height to height
tell application "System Events" to tell process "Dock"
set dock_dimensions to size in list 1
set dock_width to item 1 of dock_dimensions
set dock_height to item 2 of dock_dimensions
end tell
set p to POSIX path of ((characters 1 thru (-(offset of ":" in ((reverse of characters of (input as string)) as string)) - 1) of (input as string)) as string)
tell application "iTerm"
set newWindow to (create window with default profile command "")
end tell
delay 2
tell application "System Events" to tell application process "iTerm2"
set position of newWindow to {xV, height - tV - dock_height - bV}
set position of newWindow to {width - xV, tV}
end tell
end run