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

[JS][CS5] De-bugging with Extendscript

Participant ,
Aug 11, 2011 Aug 11, 2011

Hi. Just a quickie...

I am putting together a script that opens a txt file in a folder in relation to the script using:

var myFile = File(app.activeScript.parent + "/textFolder/roys text file.txt");

For some reason, in Extendscript i get the error "No Script is Active" when de-bugging.  The script itself does run when run from the script panel.
Is this usual behavour?
Cheers
Roy

TOPICS
Scripting
1.1K
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
Enthusiast ,
Aug 11, 2011 Aug 11, 2011

Yes it is. See http://forums.adobe.com/message/2327073#2327073 for a workaround function.

Jeff

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
Explorer ,
Jul 30, 2016 Jul 30, 2016

Sorry to be dense, but I didn't see where in that thread you linked to this issue was addressed.  Can you give some more details?

*edit* oh, I see, you linked to a specific post in that long thread, my browser didn't land on that the first time for some reason:

I use Dave Saunders function to get path to current script file folder (allows debugging)

  1. function getScriptFolder(){ 
  2.      try {  
  3.           var activeScript = File(app.activeScript);  
  4.      } catch(e) {  
  5.           // running from ESTK ...  
  6.           var activeScript = File(e.fileName);  
  7.      }  
  8.      return activeScript.parent; 
and reference to it

  1. getScriptFolder() + "\\mypic.png" 

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
Participant ,
Jul 30, 2016 Jul 30, 2016
LATEST

I encounter this issue a lot and it's very frustrating, but I find Dave Saunder's approach to be brilliant. Will start using it from now on.

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