Initiating a script from a created menu
Ok,
I admit that I am a novice with JavaScript, although I have experience developing using Xcode with ObjC and lots of interapplication scripting with AppleScript.
However, I am clearly missing some very basic concepts trying to do some very simple things to script Adobe Bridge.
For instance, I have followed the tutorials and have had no problem running and customizing versions of SnpAddMenuItem.jsx and SnpCreateThumbnailInspector.jsx.
Now, let's say I put the SnpAddMenuItem.jsx in the Startup Scripts folder for Bridge CS6. (works fine and creates menu on launch.)
However, instead of displaying an alert, as in the demo:
alertCommand.onSelect = function (m)
var txt = m.text;
// Display result as UI, as this is UI sample
alert("'" + txt + "' was chosen menu item");
// run javascript
//SnpCreateThumbInspectorPanel.Main();
I want to run SnpCreateThumbnailInspector.jsx.
Do I:
Call the script by referencing it's location on disk
Include the CreatThumbnailInspector code as a function in the AddMenuItem script and direct function.OnSelect to run that function
Or is there some other method that I am totally missing?
I have scoured the documentation and much of the sample scripts and can't seem to figure out this seemingly simple concept.
- James
There should be many examples here on the forum, here is one that you can play with...
#target bridge
if( BridgeTalk.appName == "bridge" ) {
var menu = MenuElement.find ("myNewBridgeMenu");
if (menu == null){
var newMenu = MenuElement.create( "menu", "My Bridge Scripts", "before tools/ps", "myNewBridgeMenu" );
WhatEverYouWant = MenuElement.create( "command", "Test Script", "at the end of myNewBridgeMenu", "BridgetestScript" );
WhatEverYouWant.onSelect = function () {
alert("This is my new script");
Similar Messages
-
Initiating batch scripts from Maxl Script Editor in Admin Console??
Guys,
Is it possible to initiate batch scripts from Maxl script editor in Admin Console.
I dont want to automate the scripts as my data loading process can happen at any time.
Thanks in advance
AHi A,
I'm not sure what you're asking? Do you want to run a batch of Maxl scripts, or a batch file, or a single Maxl Script? Why do you choose to use the Admin console to do this? Could you run what you're trying to run in batch from the command line?
Executing MaxL and MDX Scripts
To execute a MaxL script or an MDX script:
Open or create the script.
From the server drop-down list on the toolbar, select the Analytic Server to execute the script against.
The drop-down list contains only Analytic Servers that are displayed in your Enterprise View. For more information about connections, see Connecting to Analytic Servers in MaxL and MDX Script Editors.
Specify how errors should be handled during execution. See Setting MaxL and MDX Execution Options.
Specify how you want results to be displayed in the Results tab. See Viewing MaxL and MDX Results.
If the script contains variables, specify how undefined variables are resolved during execution. See Resolving Undefined Variables.
To execute the entire script, right-click and select Execute from the pop-up menu.
To execute only part of the script, highlight the statement or statements that you want to execute, right-click, and select Execute from the pop-up menu.
The script executes against the specified Analytic Server, and the results are displayed in the Results panel.Regards,
Robb Salzmann -
Prevent pdf initial view settings from disabling my menu bar
Some pdf files are configured with initial view settings to remove my menu bar and other toolbars. This is incredibly intrusive, and difficult to get those back unless you know the correct keyboard shortcuts. Most users don't.
So please tell me how to permanently disable pdf files from asserting their own initial view settings on my viewing environment. I do not want to permit them to take over my window and get rid of my menu bars. I find that behaviour incredibly annoying.
ThanksSorry, you can set the default view parameters only for documents that the author has not specified a view option for.
You might be able to write a plug-in that could change the open document action.
Have you tried contacting the authors about this issue? -
How to call photoshop new script from bridge tools menu
i just create a 'Image Processor Outter Mode.jsx' script for photoshop and copy to ../photoshop cs3/presets/scripts/ folder. i can see the menu item list in photoshop file->script->.
but can't find it in the bridge cs3 menu. in bridge cs3 tools->photoshop. it only list the default script, image processor for example.
i'm plan to search files in bridge and run all the result files with the new jsx. anybody can help me ?
thanks.You would need to amend Photoshop-10.jsx on a pc this would be found in the following folder:-
C:\Program Files\Common Files\Adobe\Startup Scripts CS3\Adobe Photoshop -
Can I run a shell script from the services menu?, part II
Remember this?
It is now possible.Doesn't look like there is a direct way to do it.
The services are all Bundles, which is easy
enough to fake -- just copy one from /Library/Services
to ~/Services and modify the plist. Put your shell
script in Contents/MacOS/ and identify it in the
plist under CFBundleExecutable and hope for the
best
Where it gets sticky is CFBundlePackageType (APPL
for Application, FMWK for FrameWork, BNDL for
'loadable bundle', whatever that is] and NSServices.
CFBundlePackageType should pose no problem if Services
use the OS loader and handles file magic [and '#!' of
course].
NSServices specifies a named port that the app
listens on, the data type it receives, and so forth.
This looks a bit harder to fake. I'd bet Applescript
has the functionality, and there may be some
command-line hooks to backend that, or it may be
possible to netcat your way through it.
But it doesn't look trivial
Property List Key Reference
Anyways, tried it with a quick script that echoes to a
file, and haven't figured out how to refresh the
Services menu to get it to appear. Probably have
to NetInfo it or something ridiculous; doesn't appear
to watch the FS.
[ Edited by Apple Discussions Moderator; href URL ] -
Can I run a shell script from the Services menu?
This would be kind of cool.
Is there a simple way to do this?Doesn't look like there is a direct way to do it.
The services are all Bundles, which is easy
enough to fake -- just copy one from /Library/Services
to ~/Services and modify the plist. Put your shell
script in Contents/MacOS/ and identify it in the
plist under CFBundleExecutable and hope for the
best
Where it gets sticky is CFBundlePackageType (APPL
for Application, FMWK for FrameWork, BNDL for
'loadable bundle', whatever that is] and NSServices.
CFBundlePackageType should pose no problem if Services
use the OS loader and handles file magic [and '#!' of
course].
NSServices specifies a named port that the app
listens on, the data type it receives, and so forth.
This looks a bit harder to fake. I'd bet Applescript
has the functionality, and there may be some
command-line hooks to backend that, or it may be
possible to netcat your way through it.
But it doesn't look trivial
Property List Key Reference
Anyways, tried it with a quick script that echoes to a
file, and haven't figured out how to refresh the
Services menu to get it to appear. Probably have
to NetInfo it or something ridiculous; doesn't appear
to watch the FS.
[ Edited by Apple Discussions Moderator; href URL ] -
Create Menu items from table data?
Wondering if anyone knows of a way(if even possible) to create menu items on logon from table data where the menu data is stored?
You'd have to make the menu code generic as well - probably the bet bet would be to have each menu item calling a common procedure but passing in the menu item selected - you'll then have to cross reference that with the current function of that menu item and do the right thing.
-
Unable to Create Fact and Dimension tables from the Tools menu in EIS conso
Hi All,
In the EIS console, I am unable to create the fact table and the dimension tables to produce my OLAP model from the TOOLS menu whereas I am able to create them by dragging from the left panel where the tables are displayed. I am geeting the below error message:
"An exception occured while retrieving OLAP model metadata. Please verify you are connected to the catalog and try again"
Any help appreciated.
Thanks,
RajaI have fact and dimension tables in one server and i moved those stuff to another server.If I do that what happen to essbase and about totale EPM System.I want to know how to do this and what I can expect?
Please reply -
I just started a free trial of the Adobe XI product that allows me to create an editable PDF. I'm done creating the form and ready to export it. When I click Export PDF from the File menu, it says Adobe encountered an unexpected error. What am I doing wrong?
Good to know — there is no such application as "Adobe XI".
"Adobe" is the name of the company.
"XI" is indicative of the use of either Acrobat XI or Reader XI.
Neither Acrobat XI Pro (for which Adobe provides a free, fully functional 30-day trial) nor Adobe Reader XI (the free to download and use PDF viewer that Adobe provides) have an "Export PDF" entry under "File".
"Export PDF" only is present in Adobe Reader XI over on the right on the "Tools" panel.
The "Tools" panel provides a way for a user of Adobe Reader XI to connect to various By Subscription online services (gotta pay eh).
Export PDF is one of these. A subscription lets you send a PDF file to the online internet service (aka "cloud" service). The service then exports to a supported file format (Word / Excel / ...) and the user selects / directs where the output file is to be saved on the user's local machine.
Of course to use any of the online subscription services one must have an active (paid up in full) subscription to the service.
So ---- As described the puzzle pieces don't fit eh.
What specific Adobe (the company) applications are you using?
Acrobat XI Pro? Adobe Reader XI? Both?
Be well.... -
Add link for a script from Indesign menu
Dear,
Is it possible to add a new menu on Indesign top menu near help for exemple.
And it is possible to lanche a script from it ?
thanks !Look at ScriptMenuAction.jsx in the Scripting Guide Sample Scripts. Of course it can do anything that a script can do, since it is itself a script and scripts can run scripts.
-
How to create ArrayColletion in mx:Script from <mx:Model
id="results" source="/data/data.xml" />
Please see my code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute">
<mx:Model id="results" source="/data/data.xml" />
<mx:Script>
import mx.collections.ArrayCollection;
import mx.utils.ArrayUtil;
import mx.controls.Alert;
</mx:Script>
<mx:ArrayCollection id ="dt1"
source="{ArrayUtil.toArray(results.result)}"/>
<mx:Script><![CDATA[
[Bindable]
public var expenses:ArrayCollection = dt1;
[Bindable]
public var expenses2:ArrayCollection = dt1;
[Bindable]
public var dp:ArrayCollection=expenses;
public function changeDataProvider():void{
Alert.show(expenses.toString());
if (dp==expenses){
dp=expenses2;
}else{
dp=expenses;
]]></mx:Script>
<mx:Panel x="10" y="10" width="100%" height="378"
layout="absolute">
<mx:ColumnChart dataProvider="{dt1}" x="10" y="10"
id="myChart" height="318" width="100%">
<mx:horizontalAxis>
<mx:CategoryAxis categoryField="month"/>
</mx:horizontalAxis>
<mx:series>
<mx:ColumnSeries displayName="apple" yField="apple"/>
<mx:ColumnSeries displayName="orange"
yField="orange"/>
<mx:ColumnSeries displayName="banana"
yField="banana"/>
</mx:series>
</mx:ColumnChart>
<mx:Legend dataProvider="{myChart}" x="481" y="10"/>
</mx:Panel>
<mx:Button x="284" y="416" label="Change Data" id="bt"
click="changeDataProvider()" />
</mx:Application>Tracy,
Thanks. That worked. However I have another related question:
I convert the xml feed to a XMLListCollection by doing:
<mx:XMLListCollection id="mission"
source="{xmlFeed.lastResult.day}"/>
and
<mx:XMLListCollection id="mission1"
source="{xmlFeed.lastResult.day.tBlock}"/>
On the chart I have
<mx:ColumnChart id="missionReadiness" height="150%"
width="100%"
paddingLeft="2" paddingRight="2"
showDataTips="true" dataProvider="{mission1}">
<mx:series>
<mx:ColumnSeries xField="" yField="@today"
displayName="Today"/>
<mx:ColumnSeries xField="" yField="@tomorrow"
displayName="Tomorrow"/>
<mx:ColumnSeries xField="" yField="@afterT"
displayName="After Tomorrow"/>
</mx:series>
</mx:ColumnChart>
the yField works, but for the xField I want to have the @date
but refers to the parent node, so I am clueless on how to refer to
it.
Also, I would like to display on the chart only the values to
a specific date (like @date="05/17/2007").
Any suggestions on how to do that?
Gilbert -
When I try to click on Add-ons, from the Tools menu, I get this error message of an unresponsive script: file:///C:/Program%20Files/Mozilla%20Firefox/components/nsExtensionManager.js:623. This is to say the least about the unresponsive script errors at other times. However, at all times, it won't go away - even by clicking on the 'stop script' option; even with checking the 'don't ask again' option. I've cleared the cookies and history as best I could, but it appears that there is some sort of conflict. How can I resolve this? Kevin: [email protected] Thank you.
This is typically caused by a problem with the Personas Plus 1.6 add-on and it conflicting with the Google toolbar.
Try disabling the Personas Plus add-on. To do this open the add-ons manager by selecting the Tools menu, then Add-ons. In the list of installed extensions click on Personas Plus, then click on either disable or uninstall.
If you can not access the add-ons manager, follow the instructions in the [[safe mode]] article to start Firefox in safe mode. You should then be able to disable or uninstall Personas Plus. You can find more information on this procedure in the [[Troubleshooting extensions and themes]] article. -
Create shell script from in database
Oracle version : 10.2.0.1.0
Linux redhat R5
Hi all,
I want tio create a procedure to create a shell script from within the database, but it fails.
set serverout on echo off feed on ver off
declare
sfile utl_file.file_type;
begin
sfile := utl_file.fopen('/u01/app/oracle/admin/cds/disks','disk_space.sql','w');
utl_file.put_line(sfile,'!#!/bin/sh
utl_file.put_line(sfile,'!df=`df -Pl | grep "^/dev" | awk '{print $5, $6}' | sed "s/%//"`
utl_file.put_line(sfile,'!do
utl_file.put_line(sfile,'! "Disk $fs on $HOSTNAME is $percent percent full"
utl_file.put_line(sfile,'! fi
utl_file.put_line(sfile,'!done
utl_file.fclose(sfile);
end;
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Aug 10 14:40:16 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
utl_file.put_line(sfile,'!df=`df -Pl | grep "^/dev" | awk '{print $5, $6}' | sed "s/%//"`
ERROR at line 7:
ORA-06550: line 7, column 30:
PLS-00103: Encountered the symbol "!" when expecting one of the following:
) , * & | = - + < / > at in is mod remainder not rem => ..
<an exponent (**)> <> or != or ~= >= <= <> and or like LIKE2_
LIKE4_ LIKEC_ between || multiset member SUBMULTISET_Try this:
declare
sfile utl_file.file_type;
begin
sfile := utl_file.fopen('/u01/app/oracle/admin/cds/disks','disk_space.sql','w');
utl_file.put_line(sfile,'!#!/bin/sh');
utl_file.put_line(sfile,'!df=`df -Pl | grep "^/dev" | awk ''{print $5, $6}'' | sed "s/%//"`');
utl_file.put_line(sfile,'!do');
utl_file.put_line(sfile,'! "Disk $fs on $HOSTNAME is $percent percent full"');
utl_file.put_line(sfile,'! fi');
utl_file.put_line(sfile,'!done');
utl_file.fclose(sfile);
end;PS: Not tested -
I am using Photshop CS2 on Win XP
I have configured a keyboard shortcut (Crtl+Alt+P) to run a .jsx file from the ...\Presets\Scripts\ folder.
When I activate the script via the Keyboard Shortcut ExtendScript is invoked, and breaks execution on the main() statement (see below).
When I activate the script via the File/Scripts menu ExtendScript is not invoked and the script runs to completion.
The .jsx file is a wrapper for a .vbs script which does the 'real' work.
The .jsx is:-
function main()
var VBSscript=File("C:/Program Files/Adobe/Adobe Photoshop CS2/Presets/Scripts/GGN_PS_Code_v1_2.vbs");
if(VBSscript.exists) VBSscript.execute();
main();
Does anyone have any ideas as to how to disable the invokation of ExtendScript when I run the script from the skortcut?Thanks Paul.
I am out of the office at the moment, but your answer rings true. Certainly the .jsx extension is associated with ExtendScript. I'll delete the association and try again when I am back in the office.
Many thanks -
Missing " Create Sample Java Client" from the context menu when debugging
Jdev 11.1.1.3 on Windows 7 x64
I have created an EJB - Session Bean from the ADF components and have put some logic into it with one public method.
I have exposed the method in the local interface.
I start the integrated server in the debug mode
When I right-click there is no option to do the sample client.
Am I missing a plug-in - like JUnit or something?
From the manual:
The integrated Oracle WebLogic Server runs within JDeveloper. You can run and test EJBs quickly and easily using this server, and then deploy your EJBs with no changes to them. You do not need to create a deployment profile to use this server, nor do you have to initialize it.
To run a sample client on the integrated Oracle WebLogic Server: In the Application Navigator, right-click on an EJB and choose Run.
Notice in the Message pane that Oracle WebLogic Server has been launched. Right-click on an EJB and choose Create Sample Java Client from the context menu. The default choice is to create a client for the integrated Oracle WebLogic Server, so click OK.
The client is created and opens in the code editor. If your session bean serves as a facade over JPA entities, code is generated to instantiate the query methods. If you exposed methods on your bean, the generated client contains methods that can be uncommented to call them.
After your EJB has been successfully started from the Application Navigator, right-click on the sample client and choose Run.Shay,
Pretty much what I did exactly - except - since my apps are all using the local interface - I did not create the remote.
This may be an old habit - but generally it is not a good practice to do both - though this may have changed lately.
I have this app working and the EJBs are executing fine.
I used a testview and drug the method onto it - and was able to debug it that way - but still no create java client in the menu.
Is there any other place to find this other than the context menu? Then I can check to see if it is available.
I am using WLS 10.3 that ships with Jdev 11.1.1.3 (forgot that little bit) without any changes.
Maybe you are looking for
-
CN41N and S_ALR_87013533 report not showing Production order planned cost
Hi Experts, I am having issue to get total planned production order values in my CN41N or S_ALR_87013533 cost report. I am facing 2 issues : 1. CN41N repoet does not show individual material cost planned in BOM. 2. CN41N report and S_ALR87013533 repo
-
Why won't my iPhone 5S show up in iTunes?
I know there are a lot of posts about this; basically, I am running Windows 8.1 on my laptop and I have downloaded the newest iTunes software. When I plug my iPhone 5S (ios 8.0.2) into my laptop, Windows recognises it, but iTunes will not. I have tri
-
How to make the Internal numbering as Alpha-Numeric
Hi, In the Document Info Record, the Internal numbering is always numeric. How to make it Alpha-Numeric? Regards, Shashi
-
Help! New to Mac and can't get imovie to work
hi i just bought a refurbished iMac and I'm trying to make/edit dvd's from my sony dcr-dvd203 camcorder. Since it says it doesn't support the camera I've tried burning the mini-dvd onto a regular dvd. but how do i import and save the contents of the
-
Hi Guys. I have followed Ned's code from another post, whereby if a text button is clicked, the color will change. The code is like var clicked:Boolean = false; var clicked2:Boolean = false; btn1.addEventListener(MouseEvent.CLICK, btn1click); funct