Jump to content

How to add a command to the menu for SciTE?


Recommended Posts

I want to add a command to menu SciTE to run other AU3 code. This is helper code that should just open a window and help me.

I added commands like this

# 35 Simple Snippet Manager
command.35.$(au3)="$(SciteDefaultHome)\..\AutoIt3.exe" "e:\Simple Snippet Manager\SimpleSnippetManager.au3"
command.name.35.$(au3)=Simple Snippet Manager
command.shortcut.35.$(au3)=Alt+C
command.subsystem.35.$(au3)=2
#command.save.before.35.$(au3)=2
command.quiet.35.$(au3)=1

But I had two questions.

1. How to prevent this command from trying to save the current file and not even asking about it?

2. It seems to me that this command launch incorrectly transfers the working directory. For example, I cannot see several resources from the directory ""e:\Simple Snippet Manager\". How can I set the working directory correctly?

Link to post
Share on other sites
  • Developers
Posted (edited)
2 hours ago, mike2003 said:

1. How to prevent this command from trying to save the current file and not even asking about it?

Helpfile: 

Quote
If command.save.before is set to 1, SciTE automatically saves the file before execution. If it is set to 2, SciTE will not save the file, otherwise SciTE asks you.

So remove the # at the start of that line.

2 hours ago, mike2003 said:

It seems to me that this command launch incorrectly transfers the working directory.

The workdir remains the same when you shell a command like this. Nothing to do with LUA/SciTE and actually is the same story as Run(), only there you can provide the new WorkingDirectory. ;) 
What about you handle that in your SimpleSnippetManager.au3?

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites

This is not my script, I took it from here and I would like to provide it with normal working conditions. As with a normal startup.

I will run it through another script Start SSM.au3

ShellExecute("SimpleSnippetManager.au3","",@ScriptDir)

Link to post
Share on other sites

SimpleSnippetManager needs only the ini in the exe's folder. 

The location of the needed folders are defined there. 

This is the example of my SimpleSnippetManager.ini:

[language]
00=BlitzBasic
01=D:\BB3D\IDEal\Snippets\
02=bb
10=AutoIt
11=D:\!myapps\Snippet\Snippets\
12=au3
20=Sdlbas
21=D:\!myapps\Snippet\Snippets\
22=Sdlbas
30=JavaScript
31=D:\!myapps\Snippet\Snippets\
32=js

 

 

This is how i added (just now) the manager to the SciteUser.properties, and it looks like it is running just fine

# 39 Simple Snippet Manager
command.name.39.*=SimpleSnippetManager
command.39.*="D:\!myapps\Snippet\SimpleSnippetManagerX64.exe"
command.save.before.39.*=2
command.subsystem.39.*=2

(the .* allows the tool to be shown in any window, and not only for autoIt files)

Edited by Dan_555
Link to post
Share on other sites
  • Developers

Had a play and think this is the easiest solution to first change the directory:

command.39.*=cd /d "D:\!myapps\Snippet" & "D:\!myapps\Snippet\SimpleSnippetManagerX64.exe"

Jos

 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites
  • Developers

I need exact info to be able to assist and am bad a guesswork. ;)

So simply show me the exact total command that isn't working. As the current post can't be the exact one casting that error.

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites
  • Developers

You are missing an end ".

command.36.$(au3)=cd /d "e:\AutoIt my\SSM" & "$(SciteDefaultHome)\..\AutoIt3.exe" "e:\AutoIt my\SSM\Start SSM.au3"

... and I also removed the end \ in the cd command, but guess that should work too.

 

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites
  • Developers

Just tested with this commandline:

command.49.$(au3)=cd /d "c:\temp\" & "$(SciteDefaultHome)\..\AutoIt3.exe" "$(FilePath)"

and this test.au3 script:

MsgBox(0,"test",@WorkingDir)

shows this in SciTE Output:

cd /d "c:\temp\" & "C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "D:\Development\AutoIt3\programs\test\test.au3"
>Exit code: 0    Time: 1.924

and it shows:

image.png.a7ca297972acce8227913c254948cc65.png

...so seems to be working fine for me.

Without the cd part, the msgbox shows: D:\Development\AutoIt3\programs\test  as expected.

 

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites
  • Developers

You should put the correct directory in the cd command as you left my example target!

When that still doesn't work then post the exact same information as I have done.

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites
  • Developers

Ok, so try setting the subsystem  parameter to 0:

command.subsystem.49.$(au3)=0

I have 0 for that shown command which is working for me.

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...