Rocket Software Homepage
Forum Home Forum Home > AccuTerm Knowledge Base (read only) > Scripting & Automation
  New Posts New Posts RSS Feed - Why does my Script not run after new session?
  FAQ FAQ  Forum Search   Register Register  Login Login

The AccuTerm forum has moved. Go to community.rocketsoftware.com to register for the new Rocket forum.

Forum LockedWhy does my Script not run after new session?

 Post Reply Post Reply
Author
Message
payling View Drop Down
Newbie
Newbie


Joined: April 08 2016
Location: Syracuse, NY
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote payling Quote  Post ReplyReply Direct Link To This Post Topic: Why does my Script not run after new session?
    Posted: August 11 2016 at 9:23am
I  assigned a keyboard shortcut to execute a script (.atsc) I wrote. The keyboard shortcut works great and the script performs the intended job.

I close AccuTerm and save the session.

I open AccuTerm using the saved session file, press the keyboard shortcut I setup for my script then I receive the following message: "An error occurred while compiling script at line X". 

How do I go about having the script compiled at the start of a new session so I can use it again?

If I go to script editor and open up my script I can push run and the keyboard shortcut works again. I don't really want to do that every time though...

Thanks
Back to Top
PSchellenbach View Drop Down
Admin Group
Admin Group

Moderator

Joined: December 15 2003
Location: United States
Status: Offline
Points: 2150
Post Options Post Options   Thanks (0) Thanks(0)   Quote PSchellenbach Quote  Post ReplyReply Direct Link To This Post Posted: August 11 2016 at 9:32am
Hi Paul -

I think your keyboard shortcut is referencing a function or subroutine that you load in the main script window. While the script in the keyboard shortcut is OK, unless the referenced functions are also loaded it cannot run successfully. The session (.atcf) file does not include the script to load in the main script window. Two options: start AccuTerm using a shortcut to your script (.atsc) file. This will run Main() in that script upon load - which can be an empty function. Then use File->Open to open your session (.atcf) file and your shortcut should work. Alternatively, load your script and session, then use File->Save Layout to save a "layout" (.atly) file. The layout file includes the names of all sessions that are open at the time the layout is saved, as well as the script that is loaded. Then start AccuTerm and use File->Open to open your layout file, or launch AccuTerm using a shortcut to the .atly file.

Thanks,

Pete

Back to Top
payling View Drop Down
Newbie
Newbie


Joined: April 08 2016
Location: Syracuse, NY
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote payling Quote  Post ReplyReply Direct Link To This Post Posted: August 11 2016 at 10:43am
Pete, 

The layout solution could work. I saved a layout that loads the script + opens a single session. The main downside seems to be if the layout file is double clicked again an additional session isn't opened.

Currently users have a .atcf labeled AccuTerm on their desktops. They double click the icon whenever they need to open a session. With the layout file solution users will need to learn to double click a new file to open AccuTerm then a separate Session file or File Open to open additional sessions. 

Trying to make the process as simple as possible for the end users. 

Thanks for the suggestions Pete!

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.03
Copyright ©2001-2019 Web Wiz Ltd.