Applescript : count Length

I created a code which count the length of a variable and take action regarding the length.

It's work well except when I have a variable in this format :

"00108030-00045C9E2638502E"

1: the count is returning 8 and not 25 2: I have the error :

"Can’t make 8 into type boolean." number -1700 from 8 to boolean"

Here is a preview of my code : "

set theGUIDLength to (get length of (GUID as text))
if theGUIDLength is equal to 25 or 8 then
--
end if

"


Solution 1:

I believe what you're looking for is:

if theGUIDLength = 25 or theGUIDLength = 8 then
## do code
end if