I recently updated my EmEditor.
Previously:
had macro stored locally
could be run from inside app
After update:
running macro from file within app produces "Expected statement" for a line which has been commented out in the script (preceded with "//")
However, I can run the script if I copy the script to the clipboard and run in the app by going:
Menu "Macro">>"Run clipboard".
What could be causing this and how do I get the app to run the script without having to run it from clipboard?
Related
I've written a Powershell script to automate a Web UI test using IE. The script runs fine when I execute it from PowerShell. However, I have run into an obscure problem and that is when I run my Web UI test script from another powershell script, it fails. I tried to debug it and found that it fails on the following line.
$button = $ie.Document.getElementsByTagName("button")
$button.Item().Click() # $button.Item() evaluates to null when the script is executed from another script.
Can anyone help me figure this out? It appears that when I run the script, the script has no issues locating the element, but when it is run from another script the element I am looking for cannot be located.
EDIT
I get the same error when I run the PS script through Task Scheduler. The script only works when I invoke it directly. If I invoke via another script/program, it doesn't work.
I made an exe file of labview project. The vi has a loop for a limited time and vi closes as the loop ends. When I open the exe file by double clicking, the vi opens and runs properly. BUT, if i try to run the exe file using Python script as below, the vi opens and stops at once and loop is not completed.
I have tried multiple python commands to run it, but nothing works. Hope someone knows the solution.
This is the code
import sys
import os
os.system("C:\\Users\\sjaved\\Desktop\\Pwm_MPC5748G_MT\\BSWs\\MCAL\\Pwm_MPC5748G\\targetTest\\NIPXI\\builds\\NI_Opponent\\Host\\Host.exe")
Some older versions of LabVIEW required the "Run when opened" option to be set in your top level VI's Execution preferences in order to auto-run when the app is executed. I tested this with a LabVIEW 2017 exe and python and the VI ran as expected (even without the "Run when opened" property set).
I have a simple (test) Powershell script, it creates an empty file. The script runs fine executed manually in Powershell. However it does nothing when executed in SSIS.
I've tried executing it in an Execute Process task and also in a VB.Net Script task.
Both times Poweshell seems to open (I see the screen come up and close quickly), however the file that the script tries to create doesn't get created.
Any ideas how to troubleshoot this would be appreciated!
Thank you!
Adding -ExecutionPolicy ByPass is what made it work. So now what I am passing is:
-ExecutionPolicy ByPass -file "\\SERVER\Share\Script.ps1"
This is where I got this tip - http://www.sqlservercentral.com/Forums/Topic1714552-147-1.aspx
After I added this, Read-Host started working also and paused the execution of the script.
I'm writing a script for Illustrator CS6 in ExtendScript. At the end of my script, I want to spawn a task (a second script, in Ruby) using File.execute(). However, it's not working. And I'm at a loss as how to debug the problem -- how can I figure out why this isn't working?
Here's the end of my ExtendScript file:
// Do a bunch of other work, then:
var rubyFile = new File(scriptFolder + 'BuildHtmlWalkthrough.rb');
alert(rubyFile.exists);
var result = rubyFile.execute();
alert(result);
Both rubyFile.exists and result are always true, indicating that the script launched OK. But the script does not appear to run, at all. I've tried the following diagnostics:
The Ruby script does successfully run from the command line. The script's permissions are -rwxr-xr-x
I added a call to system("touch /blah/blah/blah") as the very first line of the Ruby script. The file does not get touched.
I thought maybe the ExtendScript process was terminating before the Ruby script could run, so I added a long for loop after rubyFile.execute(). Spinning for > 30 seconds did not help.
What can I do to debug, or solve, this problem?
I'm on MacOS X v10.9.1. And for reference, this is the documentation for File.execute():
File.execute (): Boolean
Core JavaScript Classes
Executes or opens
this file using the appropriate application, as if it had been
double-clicked in a file browser. You can use this method to run
scripts, launch applications, and so on. Returns true immediately if
the application launch was successful.
It's probably doing the "opens this file using the appropriate application" instead of executing, and returns true because the file successfully opens (or is already open in its associated app). If I have a python script and do
f= new File("~/Documents/misc_scripts/getpixelrgb.py");
f.execute();
, it opens it in my script editor, even if the file's execute flags are set.
I'm on OSX, btw
In After Effects, there is system.callSystem() to execute command line commands, but I'm afraid that is absent in Illustrator (I'm assuming you're doing this for Illustrator because of the tag). Are you on OSX or Windows? There are ways around this, by making an executable .app (OSX) or .exe (Win) and calling that with execute(). If I were doing this, I'm on OSX and I'd make an AppleScript app that does 'do shell script' to make the ruby system call. On Windows, it's different. One solution you might like if you're on windows: ocra, which is ruby-specific (http://ocra.rubyforge.org/). It may be possible to run a .bat file on Windows that calls the ruby script, but I'm not sure.
[edit!]
Terribly sorry for the extraneous Windows info (for someone else, I guess). Just saw your note about being on OSX. So you might want to use the AppleScript solution.
[edit again]
So, if my ruby script ("test.rb") is:
#!/usr/bin/env ruby
print "Hello"
and my AppleScript is:
do shell script "cd /testing_folder/; ruby test.rb"
Then I get "Hello" returned in AppleScript, but ExtendScript will just return true.
I am new to applescripts and i want to automate a little bit of my app.So here is the thing
1) I am using textwrangler as an editor
2) After writing code and saving it i want to compile the file by opening terminal from applescript.I already installed llvm compiler.
3) As textwrangler provides me the a menu in meubar to open script editor so after opening it i am using "tell application "Terminal" to activate" it opens terminal
4) i want " gcc myfilename.c " to be passed as argument from applescript so that as soon terminal opens this string should be passed as argument and executable is generated
Can i Do that through scripts? Please help.
Give this a try:
tell application "Terminal" to do script "gcc myfilename.c"
Running this without the Activate line you mentioned will still open Terminal if it isn't already open, but it won't bring it to the front. For that, Just turn the whole thing into a tell block and put the Activate back in there so it becomes:
tell application "Terminal"
activate
do script "gcc myfilename.c"
end tell