Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.4: Add Programming to the Unit Converter widget' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Add Programming to the Unit Converter widget
Authored by: kainewynd2 on Jan 24, '07 05:38:43AM
I had an issue with compiling this script. It turned out that I needed to comment out the on error block. After that it seemed to work fine.

on patch(basedir, posixFilename, patchdata)
	try
		set patchResult to do shell script "cd " & (quoted form of basedir) & " ; (uudecode -p | patch -p0 ) <<-''" & return & patchdata
		
		(*on error errmsg number errnum
		if errnum ? 2 then
			display dialog errnum as string
		end if
		set patchResult to posixFilename & " is missing."
	end try*)
		return patchResult & return
	end try
end patch


[ Reply to This | # ]
10.4: Add Programming to the Unit Converter widget
Authored by: anonon on Jan 24, '07 08:41:55AM

i tried replacing the '?' with '=' in the errnum test
... i'm no applescript pro but it seemed logical

and it worked great



[ Reply to This | # ]
10.4: Add Programming to the Unit Converter widget
Authored by: kainewynd2 on Jan 24, '07 10:30:52AM

And, lo and behold, you were right. How novell...



[ Reply to This | # ]
10.4: Add Programming to the Unit Converter widget
Authored by: kainewynd2 on Jan 24, '07 10:32:00AM

or rather novel. Woo-hoo.



[ Reply to This | # ]
CORRECT FIX! Use option-equals!!
Authored by: Lectrick on Jan 24, '07 01:57:13PM
In the above referenced txt there is a question mark due to a possible encoding error of the character that is formed when you hold down option and press equals (≠). This is a standard applescript "not equals" operator.

So, if you really want to fix this without commenting out the error handling as suggested by others, change

if errnum ? 2 then

to

if errnum ≠ 2 then

Enjoy!

---
In /dev/null, no one can hear you scream

[ Reply to This | # ]

CORRECT FIX! Use option-equals!!
Authored by: Skeeve on Jan 25, '07 01:52:51AM

Oops! Didn't see that you already posted a correct fix. Thanks for that. Unfortunately a not-equal sign seems to be undisplayable here.



[ Reply to This | # ]
10.4: Add Programming to the Unit Converter widget
Authored by: Skeeve on Jan 25, '07 01:50:30AM

Actually it should have been a not-equal sign. It can be entered using /=.

That on-error part is for errors that might occure and which are not "File Exists" type of errors.



[ Reply to This | # ]
10.4: Add Programming to the Unit Converter widget
Authored by: robg on Jan 25, '07 05:17:26AM

I fixed the script; sorry for the error.

regards,
-rob.



[ Reply to This | # ]