Re: 10.6 Problem Passing "Finder" variables to subroutines
Re: 10.6 Problem Passing "Finder" variables to subroutines
- Subject: Re: 10.6 Problem Passing "Finder" variables to subroutines
- From: Matt Neuburg <email@hidden>
- Date: Tue, 08 Sep 2009 09:13:26 -0700
- Thread-topic: 10.6 Problem Passing "Finder" variables to subroutines
On Mon, 07 Sep 2009 23:26:09 -0700, email@hidden said:
>global path_to_item
>
>tell application "Finder" to my subroutine(folder itemName of
>activeFolder)
>
>on subroutine(path_to_item)
>
> -- further Applescript lines of code
>
>end subroutine
What's the first line (the global) doing in that code? It seems to me you're
likely to confuse yourself. You have a global called "path_to_item" and also
a handler local (parameter) called "path_to_item". This does no harm but it
seems like an unnecessary complication.
Anyway, back to your actual question: The real issue might be what the
"further Applescript lines of code". For example:
tell application "Finder" to my subroutine(folder 1 of desktop)
on subroutine(what)
display dialog (name of what) -- error
end subroutine
But:
tell application "Finder" to my subroutine(folder 1 of desktop)
on subroutine(what)
display dialog (get name of what) -- works fine
end subroutine
So the question could be how you are using the reference that's being passed
as parameter into the subroutine. m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden