Is there a way to reszie and reposition a quick look window with an apple script? I have an apple script that will do this with any app, but I do not know what the QL app is called. I tried, QuickLook, Quick Look and QL.
set theApp to "Finder"
set appHeight to 100
set appWidth to 1920
tell application "Finder"
set screenResolution to bounds of window of desktop
end tell
set screenWidth to item 3 of screenResolution
set screenHeight to item 4 of screenResolution
tell application theApp
activate
reopen
set yAxis to (screenHeight - appHeight) / 2 as integer
set xAxis to (screenWidth - appWidth) / 2 as integer
set the bounds of the first window to {xAxis, yAxis, appWidth + xAxis, appHeight + yAxis}
end tell
Hi.
Quick Look windows aren’t covered by the Finder’s AppleScript implementation. But assuming you have one open, it can be positioned using GUI Scripting — provided you have that enabled on your machine:
set theApp to "Finder"
set appHeight to 100
set appWidth to 1920
tell application "Finder"
set screenResolution to bounds of window of desktop
end tell
set screenWidth to item 3 of screenResolution
set screenHeight to item 4 of screenResolution
tell application "System Events"
tell application process theApp
set frontmost to true
set yAxis to (screenHeight - appHeight) / 2 as integer
set xAxis to (screenWidth - appWidth) / 2 as integer
set the position of the first window to {xAxis, yAxis}
set the size of the first window to {appWidth, appHeight}
end tell
end tell