I have Maximo 7.6.1.1.
I would like to run an automation script from a custom Action button (in WO List View).
I've created an automation script with an action as a launch point. And I think I need to somehow reference the action in Application Builder >> Select Action.
But I've been unsuccessful in doing this--I've just been making random guesses at which options to choose, and of course, it hasn't worked.
How can I run automation script from a Action in WO List View?
You first create a SIGOPTION for the application (in the Application Builder app), but with the description that you want to appear in the menu. Then, create an entry in the "select action" menu that references your sigoption (again, in the Application Builder app). You do not have to fill in any description or details in the menu entry, that will be inherited from the sigoption (which is why you created that first). Give yourself the permissions for this sigoption. This is the usual way to get a menu entry into the system to do something.
I skipped the key information to tie the sigoption/menu entry to a script for ease of explaining adding the menu entry, but there are two key things to do to make this entry run an automation script. The first is the sigoption must be named exactly the same as your action that you created for your automation script. The second is that you must select the radio button at the very bottom of the sigoption dialog, in the "Advanced Signature Options" section, labeled "This is an action that must be invoked by user in the UI".
With those things in place, your menu should now be configured to run your automation script when selected in the application.
Related
I want to make an application in C# VS12 preferably, and I want to attach it on right click menu passing the filepath as an argument, it would be great if I could do that on multiple selection too. How do I make that happen?
in the installer of your application you need to add a file extension association. (for development you can test that by registering the extension manually: right click, open with...). the file name that was clicked will be passed to your app as a command line argument (those are the args[] in the main method of you app).
multiple selection is a bit trickier but certainly doable. when your app starts you need to check if you have an instance of the app already running (using a mutex for example) and send a message to that instance with the file name you received.
If you have not worked with context menu handling, you should take a look at this tutorial.
For the file path handling, you could take a look at this image editing example.
I know nothing about AppleScript, but I wonder if it could make my life easier: is there a way to write an AppleScript that tells Safari / Firefox / Chrome to refresh the current tab when I save a document in another application, say TextWrangler? Essentially, I want to map the Command+S keyboard shortcut to do two things at once in two separate applications.
If that’s not possible, can you script one application so that saving one file executes a command in another window in that same application?
There are different possible approaches to implement this, but the most straightforward would probably be to create a script that executes all steps you need (i.e. save the document and refresh the window) and bind that to the Cmd+S keyboard combo in the triggering application.
What you need for this approach to work, is, in order:
a method to bind a key combo to a script effective only in a specific application. OS X’ Automator Services fit that bill: their scope can be restricted to a single application (select it in the “only in” drop down at the top of the workflow actions), and they can be assigned a shortcut in the Keyboard preference pane of System Preferences.
a way to relay your commands to the applications they target. AppleScript can help you in two different ways, depending on the fact if your applications are scriptable, i.e. if they have a scripting dictionary you can inspect in the AppleScript editor:
if they do, and their terminology includes the saving action for the editor on one side (most scriptable document based apps do so in the form save <document>), the page refreshing for the browser(s) on the other (Chrome has reload <tab>, Safari gets the same result via a JavaScript detour, i.e. do JavaScript "window.location.reload()" in <document> – I don’t use Firefox), you are set.
if they do not, GUI Scripting might help, i.e. simulating a click on the right UI element (menu or toolbar) via tell application "System Events" to tell process <your process> to click item x of menu y.
That script can then be embedded into the Automator workflow (in an “Run AppleScript” action, to be precise).
As you can see, a lot depends on the exact software you are using. if you are new to AppleScript and the above baffles you, I’d suggest spending a bit of time on the AppleScript pages of Mac OS X Automation (where you’ll also find example scripts which will kick start you into things like GUI Scripting).
One final note: as of this writing, sandboxed applications do not honor key combos assigned to them in the Keyboard Preference pane (they do honor global key combos set there – just not those specifically targeting them). This means you cannot, for instance, currently override TextEdit’s Cmd+S shortcut for saving in Lion. As long as your editor is not sandboxed (easily checked in Activity Monitor), you should have no issue with this.
One solution would be to create a folder action to refresh the current tab when a new file is saved in the folder.
on adding folder items to theFolder after receiving theFiles
tell application "Google Chrome"
activate
tell window 1 to tell active tab
set URL to (get URL)
end tell
end tell
end adding folder items to
What is the easiest way to make a perl app run at startup in perl code?
For example: to copy it to the "allusers" startup folder. How do I do this?
Use Task Scheduler. In Windows 7 (older Win versions are very similar):
Start -> All Programs -> Accessories -> System Tools -> Task Scheduler
Top menu: Action -> Create Task. You will get a task configuration window.
Specify a name
Choose the radio button: Run whether the user is logged on or not
Click on the checkbox: Run with highest privileges (if necessary)
Select the Trigger tab on top. Click on the New button.
From the Begin the task drop down, select At startup.
Select the Action tab on top. Click on the New button.
The Action drop down must specify Start a program. Browse and select your Perl script. Add any arguments if necessary.
The other tabs can probably be left alone. But this is the cleanest UI for creating a start up program. I believe you can also edit the registry and specify start up programs/scripts to run there, which is pretty standard practice for installation scripts.
Hope this helps.
XCode doesn't include uninstallation options for their packager. Generally users simply drag the app to the trash if they want to uninstall it - most apps are self contained in the app package.
However, I have a kernel extension which must be uninstalled using a few simple command lines. There is a script that works, but I am required to provide a graphical uninstaller.
I don't expect there's a plug-n-play example code out there that provides a way to run the script while showing a progress bar, but I'm hoping someone has dealt with this or has a few pointers on how to accomplish this quickly and easily
The script is only two lines with no feedback, so we can execute the commands in the app, as long as we can easily request and use root permissions securely (ie, let OS X handle the permissions - we merely ask for OS X to give them to us which should cause it to ask the user for them similar to how it happens with the package installer) inside the app.
There's a reasonably good approach using a Cocoa-Applescript project in xcode to run a shell script here:
http://www.mactech.com/articles/mactech/Vol.22/22.08/GUI-upyourScript/index.html
It covers using a progress bar, handling errors, and getting the correct root permissions to run the shell script.
Unfortunately it's a bit long to cut and paste here, but the general steps are:
Create new xcode project of type Cocoa-Applescript app
Create and test the intended shell script, add it to your project
Edit the MainMenu.nib to add and name a button(theObject) and progress bar(pMainProgress), then edit title and other aspects of the ui to taste
Tie the button to the applescript in the project (in the Inspector with the button selected check the action box and put in myprojectname.applescript)
Edit the applescript to something akin to the following:
on clicked theObject
-- setup
set myPath to POSIX path of (path to me) as string
-- Start progress bar
set uses threaded animation of progress indicator "pMainProgress" of window "wMain" to true
tell progress indicator "pMainProgress" of window "wMain" to start
-- Do it!
try
do shell script quoted form of myPath & "Contents/Resources/backup.sh" with administrator privileges
on error number 255
display dialog "Sorry, an error occurred. I can't make the copy."
end try
-- Stop progress bar
tell progress indicator "pMainProgress" of window "wMain" to stop
set uses threaded animation of progress indicator "pMainProgress" of window "wMain" to false
end clicked
You can further customize the app (name, for instance) and add text boxes to the window to alert the user what step is happening if you're running multiple scripts (put set the contents of text field "efStatus" of window "wMain" to "Copying files..." in your script after adding a text field to the ui with the name "efStatus")
I have to create File/Folder management system. In which user can select multiple files/folder and from context menu execute an command.
That command sends list of all selected files/folders list to invoke a process. So that, process can work on file/folder list.
If process is running the context menu should not shown or greyed out.
I added context menu but can't find the way to disable it. How can I do all this?
Any possible study link will help a lot?
Your IContextMenu::QueryContextMenu handler can apply whatever logic you desire to determine whether to show/hide a menu item, and if shown, whether it is enabled or disabled. Note, however, that in general, shell extensions should not be written in managed code due to CLR injection concerns.