Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: a handler runs after compile, but never again



On Nov 30, 2003, at 8:40 AM, Matyas Ferenc Farkas wrote:

there is the troublemaker:

The problem is that you named a variable within the handler the same as the handler. I don't know why this is a problem, but by changing the name of the variable, I was able to fix it.

I also simplified the script a bit while I was at it. Here's what I wound up with:

--tell application "Finder"
set filepathstring to "Macintosh HD:Users:spoun:Desktop:demofolder:mappa Ordner:mappa2:mappa3:"
log theContainer(filepathstring) of me
--end tell

on theContainer(filepath)
--tell application "Finder"
set AppleScript's text item delimiters to ":"
set aContainer to (filepath's text items 1 thru -3) as string
set AppleScript's text item delimiters to ""
set aContainer to aContainer & ":" as string
--end tell
return aContainer
end theContainer

Note that I commented out the tell wrappers; there is nothing in the script or the handler that requires the Finder. There might be other lines in your code that require the Finder, so I commented out rather than delete.

--Michelle

--
You can not change the world without perforce changing yourself.
_______________________________________________
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.

References: 
 >a handler runs after compile, but never again (From: Mátyás Ferenc Farkas <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.