Saturday, July 4, 2020

#1 2020-05-04 12:27:33 pm

Pace514
Member
Registered: 2019-11-19
Posts: 23

does not compile

Hi all !!!

This comes from Sal S.'s book.

Applescript:

repeat
set this_file to choose file with prompt("pick a jpeg or tiff image:)¬
default location (path to pictures folder)¬
without invisibles
set this_info to the info for this_file
if the file type of this_info is in {"
JPEG", "TIFF"} or ¬
the name extension of this_info is in {"
jpg", "jpeg", "tif", "tiff"} then
exit repeat
else
beep
diplay dialog "
The selected file is not the correct type."
end if
end repeat

Thanks for your help !

Offline

 

#2 2020-05-04 01:07:12 pm

Yvan Koenig
Member
Registered: 2006-09-14
Posts: 4533

Re: does not compile

There are two characters missing.

Applescript:

set this_file to choose file with prompt("pick a jpeg or tiff image:) default location (path to pictures folder) without invisibles

must be

Applescript:

set this_file to choose file with prompt("pick a jpeg or tiff image:") default location (path to pictures folder) without invisibles

and may be

Applescript:

set this_file to choose file with prompt "pick a jpeg or tiff image:" default location (path to pictures folder) without invisibles

Near the end,

Applescript:

diplay dialog "The selected file is not the correct type."

must be

Applescript:

display dialog "The selected file is not the correct type."

Are these typos really available in Sal's book or were they introduced by yourself ?

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) lundi 4 mai 2020 21:07:05

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)