Coder Social home page Coder Social logo

rickstrahl / commander-markdownmonster-addin Goto Github PK

View Code? Open in Web Editor NEW
9.0 9.0 6.0 4.12 MB

Commander C# Scripting Addin that can be used to automate simple tasks in Markdown Monster without creating an Addin. Launch external tools, update documents or mail merge content into the editor.

PowerShell 1.92% C# 98.08%

commander-markdownmonster-addin's People

Contributors

rickstrahl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

commander-markdownmonster-addin's Issues

Add Console Window

It would be nice to add a Console listener and display Console output in separate window on the bottom of the form. This would allow for minimal debugging and also for some way to display output information and possibly even capture console output from launched applications.

Method not found "ShowStatus"

Description

Trying to run any command gives the following error:

Method not found: Void MarkdownMonster.MainWindow.ShowStatus(System.String, Int32)'.

Environment

  • Windows 10 x64
  • MM version v1.10.5.0
  • Commander version 0.4

More Information

Even creating and running a new command with just string x = ""; fails. This is my first time trying the addin, so I don't know if it was working before.

I was hoping to use this addin to automate creating blog posts locally. Full C# scripting is pretty sweet!

Here's the log:

4/14/2018 3:31:47 PM - Last Resort Handler
Markdown Monster v1.10.5.0
10.0.16299.15.x86fre.rs3_release.170928-1534 - en-US - NET 4.7.1 - 32 bit
en-US - en-US    
---
CommanderAddin
   at CommanderAddin.CommanderAddin.RunCommand(CommanderCommand command)
   at CommanderAddin.CommanderWindow.ToolButtonRunCommand_Click(Object sender, RoutedEventArgs e)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
   at System.Windows.Controls.Primitives.ButtonBase.OnClick()
   at System.Windows.Controls.Button.OnClick()
   at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)          
---------------------------

using statements in code

Hi Rick,

if you have using statements in your code like this:

using System.Net;
using System.Collections.Specialized;


// some other code...

using (var client = new WebClient())
{
    var values = new NameValueCollection();
    values["thing1"] = "hello";
    values["thing2"] = "world";

    var response = client.UploadValues("http://www.example.com/recepticle.aspx", values);

    var responseString = Encoding.Default.GetString(response);
}

you get a compilation error because the using statement is reordered internally to the top usings:

*** Error running Script code:
6 Errors:
Line: 19 - Identifier expected
Line: 19 - ; expected
Line: 19 - ) expected
Line: 19 - Type or namespace definition, or end-of-file expected
Line: 19 - ; expected
Line: 19 - Type or namespace definition, or end-of-file expected

 1.  using System;
 2.  using System.IO;
 3.  using System.Reflection;
 4.  using System.Text;
 5.  using System.Drawing;
 6.  using System.Diagnostics;
 7.  using System.Data;
 8.  using System.Data.SqlClient;
 9.  using System.Linq;
10.  using System.Windows;
11.  using System.Collections.Generic;
12.  using Newtonsoft.Json;
13.  using Newtonsoft.Json.Linq;
14.  using MarkdownMonster;
15.  using MarkdownMonster.Windows;
16.  using Westwind.Utilities;
17.  using System.Net;
18.  using System.Collections.Specialized;
19.  using (var client = new WebClient());
20.  
21.  namespace MarkdownMonster.Commander.Scripting {
22.  
23.  public class __o0kn74b7
24.  { 
25.  
26.  
27.  public object ExecuteCode(params object[] parameters)
28.  {dynamic Model = parameters[0];
29.  
30.  
31.  // some other code...
32.  
33.  {
34.      var values = new NameValueCollection();
35.      values["thing1"] = "hello";
36.      values["thing2"] = "world";
37.  
38.      var response = client.UploadValues("http://www.example.com/recepticle.aspx", values);
39.  
40.      var responseString = Encoding.Default.GetString(response);
41.  }
42.  
43.  return null;
44.  return null;
45.  }
46.  
47.  } 
48.  }
49.  



Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.