How to to ell if a stack is loaded as a plugin
kray at sonsothunder.com
Thu Jun 2 15:29:33 CDT 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
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
-- it isn't
Hope this helps,
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/
More information about the use-livecode