• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
"result" corruption
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"result" corruption


  • Subject: "result" corruption
  • From: Steven Angier <email@hidden>
  • Date: Mon, 29 Jul 2002 18:12:42 +1000
  • Organization: Macscript.com

The following code (example 1) demonstrates how the implicit variable
"result" can be corrupted. It seems that this has something to do with
alias coercion, as I haven't been able to replicate the effects with
other classes (see example 2). Mac OS 9.2.1 / AS 1.8.3.

-- Example 1 ------------------------------------------------------

get (((path to system folder) as text) & "Preferences")


if VerifyFile(result & ":") then
set theResult to (result & ":")
else
set theResult to result
end if

return theResult
--> {alias "HD1:System Folder:Preferences:", ":"}


on VerifyFile(theFile)
try
--make sure file exists or trigger error
get (theFile as text) as alias
return true
on error
return false
end try
end VerifyFile


-- Example 2 ------------------------------------------------------

get "1.5"
if CouldBeInteger(result) then
return result as integer
else
return result
end if

on CouldBeInteger(theValue)
try
get (theValue as number) as integer
return true
on error
return false
end try
end CouldBeInteger

----


Steven Angier
Macscript.com
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: "result" corruption
      • From: Steven Angier <email@hidden>
    • Re: "result" corruption
      • From: Andy Wylie <email@hidden>
  • Prev by Date: Re: AppleWorks scripting - database question solved
  • Next by Date: Re: Bounding Rectangle [and data type Rect]
  • Previous by thread: Re: AppleWorks scripting - database question solved
  • Next by thread: Re: "result" corruption
  • Index(es):
    • Date
    • Thread