Help trying to create a button in safari please.

trying to create a button that runs an applescript. I have been discussing it in 101 but cross posting it here because it's not getting much interest over there.
Any help would be nice. I have read Become an xCoder and it doesn't seem to answer my questions.
http://discussions.apple.com/thread.jspa?threadID=1514799&tstart=0

Is there no way to create an appcontroller that works like an applescript? Or get an applescript to be recognized so a new NSButton added to the Bookmark bar be activated?
i.e.
*tell application "System Events"*
* tell application "Safari" to activate*
* keystroke "n" using {command down}*
* delay 0.1*
* keystroke "l" using {command down, shift down}*
*end tell*
Or,
_Something Like:_
/ AppController /
*#import <Cocoa/Cocoa.h>*
*@interface AppController : NSObject*
*IBOutlet id NSButton;*
*-(IBAction) autoFill:,delay 0.1,checkSpelling:(id)sender*
@end
I really don't know if that AppController looks anything like it should or if it's even close.

Similar Messages

  • I am trying to create a button in flash that will display 4 separate images at the same time when clicked.  I can't get the images to stay on when I take the mouse of the button.  I need the actions script code to make this happen.

    I am trying to create a button in flash that will allow the user to click on the button and 4 separate images show up at the same time.  I can get the images to appear when I click the button but they will not stay on the screen.  I need to know what code I use to make the images stay once the button is clicked, then I need to know exactly where I place that code.  It does not appear to be possible to add the action code to the buttons layer since each time I add a new layer I just get another "up" "over" "down" and "hit" line.
    Thank you in advance
    AP

    It is not clear how you are trying to realize this from your description.  If you are trying to create this within a button symbol it will not work.  Explain your approach and if there is code involved, show what you have so far.

  • Need help trying to use close button and i really like to know why it off

    need help trying to use close button and i really like to know why it off

    And in English? You need to explain better.
    Mylenium

  • Help trying to create multiple rectangles

    Hi, I'm trying to create a five-in-a-row game, and I need lots of rectangles, forming a kind of a net. I've figured out a bit, but the thing is that every new rectangle seems to erase all the former ones, so in the end there's just the last one. I use this code:
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import javax.swing.*;
    public class luffare extends JApplet {
    ruta rutor[] = new ruta[400];
    public void init() {
    for(int a=0;a<20;a++){
    for(int b=0;b<20;b++){
         rutor[a*20+b] = new ruta(a*10, b*10);
         //rutor[a*20+b].setBackground(Color.white);
    getContentPane().add(rutor[a*20+b]);
    class ruta extends JPanel implements MouseListener, MouseMotionListener{
    Rectangle rect;
    public ruta(int xPos, int yPos){
    rect = new Rectangle(xPos, yPos, 10, 10);
    addMouseMotionListener(this);
    addMouseListener(this);
    public void paintComponent(Graphics g){
    Graphics2D g2 = (Graphics2D)g;
    g2.draw(rect);
    public void mouseReleased(MouseEvent e){}
    public void mousePressed(MouseEvent e){}
    public void mouseDragged(MouseEvent e){}
    public void mouseMoved(MouseEvent e){}
    public void mouseClicked(MouseEvent e){}
    public void mouseExited(MouseEvent e){}
    public void mouseEntered(MouseEvent e){}
    I'm really stuck here, can anybody help?
    regards,
    M?ns Wide

    Hey, I'm no Swing expert, actually I'm very much a beginner in Swing! I suggest you go through the Swing tutorials
    {color:#0000ff}http://java.sun.com/docs/books/tutorial/uiswing/index.html{color}
    and learn about the multitude of features that can be useful to you.
    After that, if you have any problems related to Swing, please post in the Swing forum where you will get advice from real experts.
    This works, using setBounds(...) with null Layout --I've added the position number to each Ruta (size increased to 20 X 20 for that) so you can see where they go.
    file Luffare.javapackage manswide;
    import java.awt.*;
    import javax.swing.*;
    public class Luffare extends JApplet
        Ruta rutor[] = new Ruta[400];
        public void init ()
            setLayout (null);
            for(int a = 0; a < 20; a++)
                for(int b = 0; b < 20; b++)
                    rutor[a * 20 + b] = new Ruta (a * 20 + b);
                    getContentPane ().add (rutor[a * 20 + b]);
                    rutor[a * 20 + b].setBounds (a * 20, b * 20, 20, 20);
    }file Ruta.javapackage manswide;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.*;
    class Ruta extends JPanel implements MouseListener, MouseMotionListener
        Rectangle rect;
        int id;
        public Ruta (int newId)
            id = newId;
            setBorder (LineBorder.createBlackLineBorder ());
            addMouseMotionListener (this);
            addMouseListener (this);
        public void paintComponent (Graphics g)
            Graphics2D g2 = (Graphics2D)g;
            g2.setFont (new Font("Arial", 1, 9));
            g2.drawString (Integer.toString (id), 2, 10);
        public void mouseReleased (MouseEvent e) {}
        public void mousePressed (MouseEvent e) {}
        public void mouseDragged (MouseEvent e) {}
        public void mouseMoved (MouseEvent e) {}
        public void mouseClicked (MouseEvent e) {}
        public void mouseExited (MouseEvent e) {}
        public void mouseEntered (MouseEvent e) {}
    }It's good practise to place each java class in its own file.
    db
    -- To post code, use the code button or type the code tags -- [code]CODE[/code] is displayed as CODE

  • Need help trying to create a ActiveX registered event

    I am trying to create a register event for an ActiveX component. The problem I am having is creating the callback vi. When I right click on the VI ref and create the callback vi it is created with the user parameter as a variant. I would like this to be a control refnum. If I open the callback vi and replace the user parameter variant with a control refnum the wire from the callback vi to the VI ref is broken. How do I change the user parameter?

    Joe is correct on this one. The callback where designed to take variants as their inputs, so that they are more flexible. In addition Variants are used through out ActiveX programming.
    If you have a control reference that you want to pass into the VI, all you need to use is the "To Variant" function in the main VI to turn the reference into a variant. You can then inside the Callback VI you can use the Variant to Data VI to change the variant back to a reference; you simply where a constant of the reference type to the "Type" terminal.
    Evan
    National Instruments

  • Help -- Trying to create JAR file but not working

    Hi everyone
    I have created a rather noddy Java program that consists of 4 JComboBox's and 1 JButton on a JFrame.
    When the button is clicked a text file is generate with the options that have been selected.
    There are severial files that the program uses for this:
    gcc.java
    OutToFile.java
    gccConfirm.java
    MyNewWindow.java
    main.java
    I am using Jcreator and so must use the command line to create the Jar file.
    I have never done a jar file before so I did an example with a hello world program and got it working now problem. I did the same for this program and the JAR file is generated without error. I double click on the JAR file to run the application, but nothing happens. I can see the application running in memory but nothing loads on the screen. However if I run it from the command line using Java -jar gcc.jar then everything is ok.
    can anyone help me here?
    thanks in advance

    If you run you .jar from the command line (a shell in unix speak) there
    already is a console where your java program can send it's System.out
    stuff. Right click on your .jar and select 'properties' (or similar). Note
    that your .jar is run by 'javaw'. This executable is similar to the 'java'
    executable except that it doesn't open a console for you. Change the
    'javaw' command to 'java' and voila, there's your console again.
    kind regards,
    Jos

  • Please help - Trying to create a realistic liquid morphing

    Hello
    I’m fairly new to Flash and vector art but have a
    project to create a Flash based flowchart that is made up of liquid
    blobs that morph to show the various paths to the chart.
    I’ve had a go making the blobs in flash but when l go
    to animate them, it all looks a bit rubbish - see:
    http://www.mintmedia.co.uk/example2.html
    Could anyone suggest a better way of attempting to do this
    animation....
    Thanks in advance
    Rich

    Is there no way to create an appcontroller that works like an applescript? Or get an applescript to be recognized so a new NSButton added to the Bookmark bar be activated?
    i.e.
    *tell application "System Events"*
    * tell application "Safari" to activate*
    * keystroke "n" using {command down}*
    * delay 0.1*
    * keystroke "l" using {command down, shift down}*
    *end tell*
    Or,
    _Something Like:_
    / AppController /
    *#import <Cocoa/Cocoa.h>*
    *@interface AppController : NSObject*
    *IBOutlet id NSButton;*
    *-(IBAction) autoFill:,delay 0.1,checkSpelling:(id)sender*
    @end
    I really don't know if that AppController looks anything like it should or if it's even close.

  • Help trying to create a 2 page indesign doc with 1 landscape & 1 portrait page?

    I'm creating a double sided A5 flyer, how do I create a 2 page indesign document with one page portrait & the other landscape?
    Thank you in advance for anyone who can help with this ;-)

    You can use the Page tool to change one, but if it's going to print I think it would be better to make them both either ladscape or portrait, then use Rotate Spread View in the Pages panel to make one appear inthe other orientation on screen while work.

  • My iphone will not turn on...when i plug it to the computer and the wall in i get nothing. ive tried the wake/sleep button, still nothing. please help

    Iphone problems turning on!

    Looks like you'll have to visit your next Apple Store or contact Apple to get it serviced. Apple - Support - Service Answer Center

  • Creating Save Button Does Not Work - HELP!

    I am trying to create a button that will execute "Save As." I have added a regular button, and at the "click" option I enter: app.executeMenuItem("SaveAs").
    The error message I get is "Script failed (language is formcalc; context is xfa[a].form[0].form1[0].#subform[0].Button2[0]) script=app.executeMenuItem("SaveAs")
    Error:accessor 'app.executeMenuItem("SaveAs")' is unknown.
    What does this mean?? Can anyone please help, I need to get this working asap.
    Thanks in advance for help!!

    You need to change the language of the script from FormCalc to JavaScript in the drop down.
    Chris
    Adobe Enterprise Developer Support

  • New at Flash, please help! Sound On/Off Button

    I'm trying to create a button that when clicked once, it plays music, and when clicked again, it stops. I don't need the button image to change at all, I just need a simple start/stop.
    I've been able to make the button start the music when clicked but I've not been successful in making it stop.
    I am using CS4, and have no scripting experience.
    This is for a graphic arts assignment so please help!

    drag your button to the stage and assign it an instance name (eg, btn).  you can then use:
    var sound:MP3=new MP3();
    var sc:SoundChannel = sound.play();
    btn.addEventListener(MouseEvent.CLICK,f);
    function f(e:MouseEvent):void{
    if(sc){
    sc.stop();
    sc=null;
    } else {
    sc=sound.play();

  • How can i create a button with richText display instead of label

    Hi All,
    I'm trying to create a button that will look exactly as the regular spark button but will have more than one color in his label (Like attached 'buttonPic.jpg')
    I have tried to create a new button skin and new button component that will replace the label text and will to the job, but still it looks like the button original class overides the richText definitions. (Code attached)
    Maybe there is other solution?
    This is my extra code in the MyButtonSkin
         <!-- layer 8: text -->
        <!---
        @copy spark.components.supportClasses.ButtonBase#labelDisplay
        -->
        <s:Label id="labelDisplay"
                 visible="false">
        </s:Label>
        <s:RichText id="exLabelDisplay"
                    color="0x900000"
                    textFlow="{TextConverter.importToFlow(htmlTextAsHTML, TextConverter.TEXT_FIELD_HTML_FORMAT)}"
                    left="7" right="7" top="2" bottom="2">
        </s:RichText>
        <fx:Declarations>
            <fx:String id="htmlTextAsHTML"><![CDATA[<p><b>0</b>+</p>]]></fx:String>
        </fx:Declarations>

    Hi mewk,
    probably it was a catch due to eyes that actually got a bit of sleep
    anyway small test app
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/halo" minWidth="1024" minHeight="768">
    <fx:Script>
    <![CDATA[
    protected function updateBtn_clickHandler(event:MouseEvent):void
    richbtn.label=mytext.text;
    ]]>
    </fx:Script>
    <s:Button id="richbtn" x="69" y="58" width="169" height="83" skinClass="ButtonSkin1" label="&lt;p&gt;hello&lt;/p&gt;&lt;p&gt;goodbye&lt;/p&gt;"/>
    <s:Button x="70" y="333" label="Update rich button" id="updateBtn" click="updateBtn_clickHandler(event)"/>
    <s:TextArea x="69" y="174" id="mytext" text="&lt;p&gt;hello&lt;/p&gt;&lt;p&gt;&lt;b&gt;bold&lt;/b&gt;&lt;/p&gt;"/>
    </s:Application>
    and a skin with minimal change
    <?xml version="1.0" encoding="utf-8"?>
    <s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"
                 xmlns:fb="http://ns.adobe.com/flashbuilder/2009" minWidth="21" minHeight="21" alpha.disabled="0.5">
        <fx:Metadata>
            <![CDATA[
            [HostComponent("spark.components.Button")]
            ]]>
        </fx:Metadata>
        <fx:Script fb:purpose="styling">
            <![CDATA[        
    import flashx.textLayout.conversion.TextConverter;
                static private const exclusions:Array = ["labelDisplay"];
    override public function get colorizeExclusions():Array {return exclusions;}
              override protected function initializationComplete():void
                    useBaseColor = true;
                    super.initializationComplete();
    override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number) : void
                    var cr:Number = getStyle("cornerRadius");
                    if (cornerRadius != cr)
                        cornerRadius = cr;
                        shadow.radiusX = cornerRadius;
                        fill.radiusX = cornerRadius;
                        lowlight.radiusX = cornerRadius;
                        highlight.radiusX = cornerRadius;
                        border.radiusX = cornerRadius;
                    if (highlightStroke) highlightStroke.radiusX = cornerRadius;
                    super.updateDisplayList(unscaledWidth, unscaledHeight);
                private var cornerRadius:Number = 2;
            ]]>       
        </fx:Script>
        <!-- states -->
        <s:states>
            <s:State name="up" />
            <s:State name="over" />
            <s:State name="down" />
            <s:State name="disabled" />
        </s:states>
        <!-- layer 1: shadow -->
        <s:Rect id="shadow" left="-1" right="-1" top="-1" bottom="-1" radiusX="2">
            <s:fill>
                <s:LinearGradient rotation="90">
                    <s:GradientEntry color="0x000000"
                                     color.down="0xFFFFFF"
                                     alpha="0.01"
                                     alpha.down="0" />
                    <s:GradientEntry color="0x000000"
                                     color.down="0xFFFFFF"
                                     alpha="0.07"
                                     alpha.down="0.5" />
                </s:LinearGradient>
            </s:fill>
        </s:Rect>
        <!-- layer 2: fill -->
        <s:Rect id="fill" left="1" right="1" top="1" bottom="1" radiusX="2">
            <s:fill>
                <s:LinearGradient rotation="90">
                    <s:GradientEntry color="0xFFFFFF"
                                     color.over="0xBBBDBD"
                                     color.down="0xAAAAAA"
                                     alpha="0.85" />
                    <s:GradientEntry color="0xD8D8D8"
                                     color.over="0x9FA0A1"
                                     color.down="0x929496"
                                     alpha="0.85" />
                </s:LinearGradient>
            </s:fill>
        </s:Rect>
        <!-- layer 3: fill lowlight -->
        <s:Rect id="lowlight" left="1" right="1" bottom="1" height="9" radiusX="2">
            <s:fill>
                <s:LinearGradient rotation="90">
                    <s:GradientEntry color="0x000000" alpha="0.0099" />
                    <s:GradientEntry color="0x000000" alpha="0.0627" />
                </s:LinearGradient>
            </s:fill>
        </s:Rect>
        <!-- layer 4: fill highlight -->
        <s:Rect id="highlight" left="1" right="1" top="1" height="9" radiusX="2">
            <s:fill>
                <s:SolidColor color="0xFFFFFF"
                              alpha="0.33"
                              alpha.over="0.22"
                              alpha.down="0.12" />
            </s:fill>
        </s:Rect>
        <!-- layer 5: highlight stroke (all states except down) -->
        <s:Rect id="highlightStroke" left="1" right="1" top="1" bottom="1" radiusX="2" excludeFrom="down">
            <s:stroke>
                <s:LinearGradientStroke rotation="90" weight="1">
                    <s:GradientEntry color="0xFFFFFF" alpha.over="0.22" />
                    <s:GradientEntry color="0xD8D8D8" alpha.over="0.22" />
                </s:LinearGradientStroke>
            </s:stroke>
        </s:Rect>
        <!-- layer 6: highlight stroke (down state only) -->
        <s:Rect left="1" top="1" bottom="1" width="1" includeIn="down">
            <s:fill>
                <s:SolidColor color="0x000000" alpha="0.07" />
            </s:fill>
        </s:Rect>
        <s:Rect right="1" top="1" bottom="1" width="1" includeIn="down">
            <s:fill>
                <s:SolidColor color="0x000000" alpha="0.07" />
            </s:fill>
        </s:Rect>
        <s:Rect left="2" top="1" right="2" height="1" includeIn="down">
            <s:fill>
                <s:SolidColor color="0x000000" alpha="0.25" />
            </s:fill>
        </s:Rect>
        <s:Rect left="1" top="2" right="1" height="1" includeIn="down">
            <s:fill>
                <s:SolidColor color="0x000000" alpha="0.09" />
            </s:fill>
        </s:Rect>
        <!-- layer 7: border - put on top of the fill so it doesn't disappear when scale is less than 1 -->
        <s:Rect id="border" left="0" right="0" top="0" bottom="0" width="69" height="20" radiusX="2">
            <s:stroke>
                <s:LinearGradientStroke rotation="90" weight="1">
                    <s:GradientEntry color="0x000000"
                                     alpha="0.5625"
                                     alpha.down="0.6375" />
                    <s:GradientEntry color="0x000000"
                                     alpha="0.75"
                                     alpha.down="0.85" />
                </s:LinearGradientStroke>
            </s:stroke>
        </s:Rect>
        <!-- layer 8: text -->
    <s:RichText id="LabelDisplay"
    color="0x900000"
    textFlow="{TextConverter.importToFlow(hostComponent.label, TextConverter.TEXT_FIELD_HTML_FORMAT)}"
    left="7" right="7" top="2" bottom="2">
    </s:RichText>   
    </s:SparkSkin>

  • Is there a way to create a button that works the same as the ImageField?

    I am trying to create a button that acts like the ImageField tool. I want to be able to click on the button and it will direct me to browse for my photo that I want to attach.
    I am using LiveCycle. (I am a nooby and have limited skills when it comes to script)
    The ImageField function is to complex of a function for the use on my IPAD (PDF Expert APP). I can create a photo button using Adobe Form Creater and it works fine with the below script:
    event.target.buttonImportIcon ();
    This is a mouseup Action Event.
    My form that has been created in LiveCycle works perfectly on my IPad, except the photos. If I can simplify the function of the photos to act more like the Adobe Form Creater tool, then perhaps it will all work together.
    Any ideas, or is this just a waste of time? I have created the form over using Adobe Form Creater, but it has some limitations that make it not function as nice as LiveCycle's form.
    Thanks

    Not in Acrobat unless your image is already in the PDF format.
    This is a feature of forms created with LiveCycle Designer.

  • How to create multiple buttons in ALV Toolbar in Webdynpro ABAP

    Hi all,
    I am trying to create multiple buttons in Webdynpro  ALV toolbar, please go through the code.
    What happening is, second button is replacing the first one.
    DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
       lo_cmp_usage =   wd_this->wd_cpuse_alv_table( ).
       IF lo_cmp_usage->has_active_component( ) IS INITIAL.
         lo_cmp_usage->create_component( ).
       ENDIF.
       DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
       lo_interfacecontroller =   wd_this->wd_cpifc_alv_table( ).
        DATA lv_value TYPE REF TO cl_salv_wd_config_table.
       lv_value = lo_interfacecontroller->get_model(
       DATA lr_buttonui1 TYPE REF TO cl_salv_wd_fe_button.
       DATA lr_buttonui2 TYPE REF TO cl_salv_wd_fe_button.
       DATA button1 TYPE REF TO cl_salv_wd_function.
       DATA button2 TYPE REF TO cl_salv_wd_function.
    **First button
       CREATE OBJECT lr_buttonui1.
       lr_buttonui1->set_text('Button')."setting the text of the button on alv toolbar
       button1 = lv_value->if_salv_wd_function_settings~create_function( id = 'BUTTON')."creating the function for alv button
       button1->set_editor( lr_buttonui1 ).
    **Second button
       CREATE OBJECT lr_buttonui2.
         lr_buttonui2->set_text('Button1')."setting the text of the button on alv toolbar
       button2 = lv_value->if_salv_wd_function_settings~create_function( id = 'BUTTON' )."creating the function for alv button
       button2->set_editor( lr_buttonui2 ).
    How can I overcome this??
    Thanks
    Eshwar

    Hi Eshwar,
    The button Ids are same for both the buttons in your code. You need to change it as BUTTON1, BUTTON2.
    **First button
       CREATE OBJECT lr_buttonui1.
       lr_buttonui1->set_text('Button')."setting the text of the button on alv toolbar
       button1 = lv_value->if_salv_wd_function_settings~create_function( id = 'BUTTON1')."creating the function for alv button
       button1->set_editor( lr_buttonui1 ).
    **Second button
       CREATE OBJECT lr_buttonui2.
         lr_buttonui2->set_text('Button1')."setting the text of the button on alv toolbar
       button2 = lv_value->if_salv_wd_function_settings~create_function( id = 'BUTTON2' )."creating the function for alv button
       button2->set_editor( lr_buttonui2 ).

  • Unnable to create SAVE_VIEW button in WAD vers 7.01

    Hi All
    I'm trying to create a button "Save View" with a command SAVE_VIEW in my WAD application. I would like that it works in the same way like in 3.5 Version (standard AdHoc Web Template). But this function doesn't work in my BI version 7.01 SP6.
    For parameters to the command SAVE_VIEW in my WAD I have to enter the technical name of an (existing!) query view and a description (?!). Actually I would like that each user can decide yourself how the view will be named and save it only localy in their favorits. But no "save"-dialog appears when pressing the created button Save View in Web.
    What are the tricks for giving a possibility for the enduser to save an own local view of a running Web report?
    Thanks,
    Elvira

    Hi
    What parts of the code are relevant?  I need one button that represents the open view selection?
    Thanks
    DV

Maybe you are looking for

  • Mid 2011 Macbook Air part number ZOMF?

    I have a mid 2011 Macbook air with a part no. of ZOMF0002E.  I can't find the ZOMF family id or this part no anywhere.  Why isn't the model no. something like the standard MC968 LL/A

  • Can't get it to work

    I've exhausted everything with my LaCie 1TB drive connected to my G5 iMac: • Formatting the partition to Apple Partition Map • Formatting to GUID (just in case) • Plugging the drive directly into the iMac • Trying the other Firewire port • Connecting

  • Header Footer tool replaces headers and footers in PDF

    The header/footer tool replaces the headers and footers in my PDF, this header and footer I am referring to was not added in Adobe but was added in Word 2010, when I tried to add an additional header to my PDF (I added a page number) it replaced the

  • User input in JDeveloper IDE not working?

    We just started to use JDeveloper. so the problem may be very basic, I could not figure it out what is wrong: I have a java class which is calling a third part application (Lotus Notes, domino server). The task of the class is to open a database on d

  • Bring All to Front

    This appears under the "Window" menu in most applications. What does it do? Thanks, Paul