#GPT-4 Conversation #1096114551193342002
1 messages · Page 1 of 1 (latest)
** "Syntax Error: Expected end of line but found identifier." Why this not working?
-- Prompt for user to select capture area and save to file
display dialog "Please select a capture size and press Enter to continue." with title "Screen Capture Script"
-- Get the bounds of the screen
set screenBounds to bounds of window of desktop
-- Calculate the possible capture sizes based on the screen size
set possibleSizes to {{1280, 800}, {800, 1600}, {640, 400}, {400, 640}, {320, 200}, {200, 320}, {160, 100}, {100, 160}}
set captureSizes to {}
repeat with size in possibleSizes
if (item 1 of size) = (item 1 of screenBounds / 2) and (item 2 of size) = (item 2 of screenBounds / 2) then
set end of captureSizes to size
end if
end repeat
-- Prompt user to select a capture size
set sizeStrings to {}
repeat with size in captureSizes
set end of sizeStrings to (item 1 of size as text) & " x " & (item 2 of size as text)
end repeat
set sizeIndex to button returned of (display dialog "Please select a capture size:" buttons sizeStrings)
-- Use the selected capture size to calculate the capture area
set captureSize to item sizeIndex of captureSizes
set captureArea to {0, 0, item 1 of captureSize, item 2 of captureSize}
-- Prompt user to position the capture area
set confirmButton to "Capture"
repeat while confirmButton is "Capture"
set captureArea to choose rectangle with prompt "Please select a capture area:" default dimensions captureArea
set confirmButton to button returned of (display dialog "Is this the correct capture area?" buttons {"Capture", "Cancel"})
end repeat