How to to ell if a stack is loaded as a plugin

Ken Ray kray at sonsothunder.com
Thu Jun 2 16:29:33 EDT 2011


>> In fact I think any test based on the directory wouldn't be so good.  There
>> would always be the chance that you opened through the file browser.
> 
> A plugin is just a stack that can be conveniently opened by placing it
> in the Plugins folder.
> 
> If you take it out of the folder, that distinction is lost.

So that means that your directory-based test is the way to go, something
like:

put revEnvironmentPluginsPath() into tPlugPath1
put revEnvironmentUserPlugsinPath() into tPlugPath2
put the fileName of the mainstack of <stackRef> into tFileName
if (char 1 to length(tPlugPath1) of tFileName = tPlugPath1) or \
  (char 1 to length(tPlugPath2) of tFileName = tPlugPath2) then
  -- it's a plugin
else
  -- it isn't
end if

Hope this helps,

Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/






More information about the use-livecode mailing list