Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

global.subscribe at folder-level script

Community Beginner ,
Jul 15, 2025 Jul 15, 2025

i try for test 

 
global.radius=2;
global.subscribe("radius", RadiusChanged);
function RadiusChanged(x)  
{
   app.alert(x);
}

 i have 

Exception in line 2 of function top_level, script Folder-Level:App:test.js

GeneralError: Operation failed.
Global.subscribe:2:Folder-Level:App:test.js

whats wrong ?

TOPICS
JavaScript
127
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 15, 2025 Jul 15, 2025

What are you trying to do?  Line 2 doesn't make sense.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 15, 2025 Jul 15, 2025

general error != sense absense  🙂

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 15, 2025 Jul 15, 2025

global has no function wth the name subscribe

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 15, 2025 Jul 15, 2025

subscribe is global method

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 15, 2025 Jul 15, 2025

RadiusChanged is not defined 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 15, 2025 Jul 15, 2025

That shouldn't matter. It appears like that in the Reference and it works from the Console, just not from a folder-level script, not even if you place it in a trusted function. It seems it can't be used in that way.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 15, 2025 Jul 15, 2025
LATEST

global.subscribe("radius", RadiusChanged); must be declared from an open document.  You get an error in a folder level script because it runs before a document is open.  Remove it from the folder level script and put it in a document level script.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines