Xcode and AppleScript HELP

Hey everyone! OK, so recently I've been doing a lot of Xcode and AppleScript, and today I decided to combine them. So I created a new Cocoa AppleScript project in Xcode. First, I decided to start simple and make a simple clickable button that would make a pop-up appear when cliked. Here is the code I used, the part I wrote in bold:
--  AppDelegate.applescript
--  AppleScript
--  Created by ----- on 29/04/13.
--  Copyright (c) 2013 ----- All rights reserved.
script AppDelegate
property parent : class "NSObject"
    on doButtonStuff_(sender)
        display dialog "Hello World"
    end doButtonStuff_
          on applicationWillFinishLaunching_(aNotification)
  -- Insert code here to initialize your application before any files are opened
          end applicationWillFinishLaunching_
          on applicationShouldTerminate_(sender)
  -- Insert code here to do any housekeeping before your application quits
                    return current application's NSTerminateNow
          end applicationShouldTerminate_
end script
I thought it was all going well, but when I selected the button (in the interface builder) and clicked on the 'Connections Inspector' it wasn't there!
Please tell me what part of my code is wrong therefore not making the bold code not show up in the 'Connections Inspector' and how I can fix it. Thanks very much!!

There isn't anything wrong with your code - inspecting the button won't show anything until it is connected to something.  There are a couple of ways to make a connection - right-click on the button and connect the selector (under Sent Actions) to the blue cube representing the AppDelegate (the handlers will appear in a list to choose from), or click on a blue cube (the one representing the AppDelegate or whatever class the handler is in) and look under Received Actions for a list of handlers to connect to your object.
The second way may be easier to start with, since it shows all of the outlets and actions in a single list, for example:

Similar Messages

  • Xcode and network password

    Hey All,
    I am writing my first application in Xcode and everything is working fine except for a password issue.
    A little background;
    I have a simple application that when a button is clicked, an AppleScript is launched and loads a Growl notification on my local machine and another computer on the local network. I have store the password in the script in the form of "eppc://USER:[email protected]".
    The issue I am having is that every time my app is launched and sends the command to the remote computer I get a dialog that asks for the username and password to use on the remote computer. I enter the user and pass and tell it to add to my keychain. As long as a leave the application open it never asks again. If I close and relaunch the application it will ask for the user and pass again. The information is being added to my keychain but it doesn't seem to want to use it.
    Here is my question:
    Is there a different way to need to save the user and pass in my script so I don't have to enter it every time I launch the application? I don't mind if it is stored in cleat txt as we are on a secure access network and everyone with access to the script already knows the user and pass.
    Thanks in advance for any help,
    GaffMan

    http://developer.apple.com/library/mac/search/?q=keychain
    Keychain Services Programming Guide 
    Keychain Services Tasks for Mac OS X 
    Keychain Services Concepts 
    Certificate, Key, and Trust Services Programming Guide 
    Glossary 
    Certificate, Key, and Trust Services Tasks for iOS 
    Secure Coding Guide 
    Mac OS X and iOS Security Services 
    Developing Secure Software 
    Security Overview 
    Security Services 
    Security Architecture 
    Keychain Services Reference 
    SFKeychainSettingsPanel Class Reference 
    SFKeychainSavePanel Class Reference 
    Mac OS X Man Pages 
    systemkeychain(8) Mac OS X Manual Page 
    security(1) Mac OS X Manual Page 
    Keychain APIs Release Notes 
    QA1486: Programmatically Accessing and Manipulating Multiple Keychain Items 
    Certificate, Key, and Trust Services Reference 
    Good luck

  • How can i create link between ipad(xcode) and webserver?

    Hi, I'm a new to iPad development and i need help,
    i'm not good with english but i try to explain my question:
    how can i create link between ipad(xcode) and webserver?
    (the webserver ".NET" with driver odbc is connected with DB Oracle)
    so, how can my ipad application access to the Oracle DB?
    Create a webservice (.NET) to be place between iPad and DB, is this correct?
    how can i do it?
    which are libraries to include in the xcode's framework?
    thx

    I think the following URL will be your best answer:
    http://stackoverflow.com/questions/3510468/connecting-iphone-to-an-odbc-database

  • How to create fxplug transition for xcode and quatrz composer

    how to create fxplug transition for xcode and quatrz composer?

    Hi Mohan,
    You have to create and configure your system in the system administration tab in the portal.
    Usually, it looks like the following:
    System from template: JDBC System
    Connector properties
       Connection URL: jdbc:sap:sqlserver://<serverlocation>;DatabaseName=<database name>
       Driver class name: com.sap.portals.jdbc.sqlserver.SQLServerDriver
    User management properties
       User mapping type: admin, user
    Set the system with an alias.
    Go to user administration tab and map the user with VCRole to the configured system
    (the default for MSSQL is usauly user: sa and pw: admin)
    Save your changes and logon to VC with this user.
    The alias name should appear in your list of systems.
    Hope I helped,
    Shay

  • Xcode and older Java projects

    Help!
    Recently I've tried to re-run some older Java Xcode projects and have received this error message:
    "Jam is deprecated and has been removed; targets that use Jam must be upgraded to native targets. For more information on doing this, consult the Xcode documentation."
    I can get around the problem by copying the old code into a newly created project; however, when I tried to follow the instruction in the error message and consult the Xcode documentation, I could find no information on how to do this. I have tried searching the user docs for all of the terms in the above message with no useful results. Selecting "Upgrade all targets to native" from the Project menu produces a warning that this is not supported in Java.
    I must be missing something really obvious. Can anybody tell me what is going on?
    Thanks, dcl

    Thanks for the quick reply, Karl.
    I should have mentioned that I'm pretty much a beginner with Xcode and Java (actually, with software in general). I get the impression that you don't think that Xcode is a very good way to develop Java. Why is that?
    For my level of programming it works just fine (usually). If I start with a new project there is no problem; however, I can't go back and work on older projects because of the problem I mentioned in the original email.
    Any clues as to what is going on?

  • Xcode and C/C++

    I recently upgraded my Leopard to SL. I then installed Xcode 3.2.1, but I'm no longer able to create regular C/C++ projects. Can anyone help me?

    I'm assuming that by "them" you mean the Carbon project templates. You have to install Xcode 3.1, at least temporarily. You can have Xcode 3.1 and 3.2 installed on the same computer.
    After you install Xcode 3.1, copy the Carbon application templates to the location of user project templates. The Carbon templates are in the following directory:
    XcodeInstallLocation/Library/Xcode/Project Templates/Application
    Where XcodeInstallLocation is the directory where you installed Xcode 3.1. Copy the templates to the following directory:
    /Library/Application Support/Developer/Shared/Xcode/Project Templates/Carbon
    You will have to manually create some of the folders in that path, at least the Project Templates and Carbon folders. After copying the Carbon project templates, restart Xcode and create a new project. Under User Templates, there should be a Carbon entry. Select it and you should be able to choose the Carbon application projects. At this point, you can uninstall Xcode 3.1.

  • Cheapest option for someone new to mac wanting to use xcode and try develop

    Hi
    Apologies if this is in wrong location but couldnt find a general section
    I havent used mac before, looking to find cheapest option to get in to the mac World and try my hand with xcode / develop the likes of an app for iphone for fun
    Had found a imac5 1 but when I researched further it would appear that I might not be able to use this for latest version of xcode and therefore wouldnt suit my need. Shame as I think I could have got it for €300
    Am I correct - in that its not suitable?
    Any suggestions on what else would be suitable or where I could start?
    I couldnt afford to spend €1,000 or more on a new mac whether it was desktop or laptop etc.
    I want to get something thats useable (not from the dark ages) but realise that I may have to go back at least a few years thus the reason I was looking at the imac5,1
    Thanks for your time. Any help advise etc would be appreciated.

    The latest XCode requires OSX Lion. That requires:
    Intel Core 2 Duo, Core i3, Core i5, Core i7, or Xeon processor
    2GB of RAM
    Mac OS X 10.6.6 or later with the Mac App Store installed
    At least 4GB of additional disk space to accommodate the download, but more is obviously recommended
    Thus, assuming that whan you said imac5 you were referring to an iMac with an Power PC G5 processor you are right i that that is not compatible.
    There are some Mac with an Intel Core sSolo and just Intel Core Duo processor that will not work with the latest XCode.
    I would look for a Mac Mini 2007 or later since those meed the XCode requirements

  • Learning Unix and AppleScript on Lion

    Hi everyone,
    I want to learn Unix on OS X Lion and AppleScripts very well. I've been a Mac user since Tiger OS X, but now I've decided to be serious about Unix and AppleScript. Can anybody recommend good books for this purpose. I would like to have books which start from basics but later go on to great details to fully explore these two things. I really need expert opinion here, plz.
    Best,
    Naveen

    If you already know something about unix commands, there is a scripting tutorial at http://www.tldp.org/LDP/abs/html/index.html
    If you need a tutorial on unix commands, http://osxfaq.com/Tutorials/LearningCenter/UnixTutorials/LoseTheMouse/index.ws had a pretty good tutorial, although at the moment, that link isn't loading for me now so I don't know if it is still up online or not.
    for creating logout hooks, http://www.bombich.com/mactips/loginhooks.html might help.
    Also, in Terminal, type man launchd.plist if you can think of a scenario where you could implement a "cron-like" solution. Then refer to Apple's own periodic daily/weekly/monthly launchd plists (com.apple.periodic-*ly.plist) at/System/Library/LaunchDaemons/. There are more triggers available than just day/date/time, such as "watchPaths" and "RunAtLoad." Home grown launchd plists ones should go in /Library/LaunchDaemons/ or Library/LaunchAgents, not /System/Library/LaunchDaemons/. Also man launchd (no ".plist").

  • Applescript help to select incoming message from inbox.

    Hi I am in need of an applescript that takes an incoming message file from my "Temp" mail directory, then copies it's "body text",
    and copies it's text to specific new directory folder.
    Example:
    Mail Subject = RenameFolder
    Body of email =  Joe Doe - Photo
    I have this so far.....  I have the mailbox selection working....   the rest is beyond my scripting abilities.
    tell application "Mail"
              set the selected mailboxes of the front message viewer to {mailbox "Temp" of account "Rons"}
    end tell
    I need it to select the message with subject matching "RenameFolder" and copy body test "Joe Doe - Photo"
    to a new folder inside  "/Volumes/Flix Media/Customer/Photo/"
    I hope this all make sense.
    Any and all help is appriciated.
    Ron

    take a backup of ur phone on PC. and then apply hard reboot on device. Just press *#7370# and see everything will be flushed out frm your device.
    regards
    Nitin SuperByte
    Moderator note: telephone no removed
    Message Edited by spanishtaco on 21-Apr-2008 03:21 PM
    Regards:
    Nitin SuperByte
    Forum Nokia Champion

  • New to Mac and AppleScript

    Hello all - I am new to both Mac's and AppleScript, so yes - I need help! I want to be able to delete objects from an attached USB drive, without having to empty the "trash". I can open a terminal window, type "rm -r " and then drag the objects from Finder to the open terminal window and they are truly deleted from the attached usb drive. I am hoping that this could be setup within a script that would then "appear" as an icon on the desktop - so one could simply drag objects from Finder to this new icon, rather than the trash, and be able to delete absent dumping the entire trash can. Thanks in advance - Bob

    This is pretty straightforward.
    on open dropped_items
      repeat with each_item in dropped_items
        set filePath to POSIX path of each_item
        do shell script "rm -r " & quoted form of filePath
      end repeat
    end open
    Save it as an AppleScript Application and you're done - it takes a list of the items dropped onto it (referenced as dropped_item and iterates through the list. For each item in the list (each_item) it calculates the UNIX path (shell commands require UNIX paths, not regular file references), and passes that to a shell script that performs the rm

  • Help, new to Linux and need help installing 8i

    I am new to Linux and some of this stuff..
    Yet,I have gotten the JDK116_v5 installed and working on my box.
    I have cut a cd for Oracle8i and need help..
    I have also recopiled my kernal as well...
    Does any one know where I can get help...
    null

    Al Pivonka (guest) wrote:
    : I am new to Linux and some of this stuff..
    : Yet,I have gotten the JDK116_v5 installed and working on
    : my box.
    : I have cut a cd for Oracle8i and need help..
    : I have also recopiled my kernal as well...
    : Does any one know where I can get help...
    Try http://www.akadia.com/html/dod-frame.html for Redhat.
    http://www.suse.de/~mha/oracle/ for SuSE
    Also peruse these
    http://www.akadia.com/html/dod-frame.html
    http://jordan.fortwayne.com/oracle/
    Colin.
    null

  • Software update and iLife help not working in Admin account

    For the last few weeks (maybe since iLife 11 was installed) software update and iLife help has quit working on the single administration account on my iMac. All works fine on the secondary accounts.
    If I try to use software update it says everything is up to date, even though I know there are updates available that can be seen if checking from a different account on the machine. In iLife, if I try to access the help files it tells me I need to download them. I click to download and after a few seconds it takes me back to the front help page and I then go through the entire process again but the help download never happens. On secondary accounts the help files work no problem.
    I've tried many of the tips for deleting helpfile plists, but nothing seems to work for me.
    Can any kind person list for me everything I should look to delete or move in the account to get these things working again?
    It would be much appreciated!

    Since the issue is specific to your original user account, you can proceed in two ways. One is to log into your new account, make a list of the preference files (plists) located in /username/Library/Preferences/, including any in the ByHost subfolder, log back into the original account, move everything on that other account's list from the original account's Preferences folder into a newly created folder on the Desktop, log out and back in, and see if the problem goes away. If so, you can copy the ones in the Desktop folder (one at time) back into /Preferences/, restart, and see if the problem returns. If so, you've identified the corrupt/conflicting one. Continue with all of them until isolating the bad ones. That'll save you the trouble of resetting preferences.
    The second way is much more detailed and I'll not burden you with the steps unless the above doesn't fix the issue.

  • A follow up question to Introducing Apple Recommends, Manage Subscriptions, and This Helped Me

    In Introducing Apple Recommends, Manage Subscriptions, and This Helped Me it was written
    Now anyone can click "This helped me" to say thanks to helpful members. When several people mark the same post, it will earn a gold star and appear at the top of the discussion, so it’s easier for others to find. The poster will also earn five reputation points for a job well done.
    Does anyone know (or is it written anywhere) just how many is 'serveral'? Is it decided on the fly? Or does it depend on the phase of the moon?
    Will the points be awarded to the poster only once, or if say 100 people mark it as helpful will more then 5 points be awarded?
    Sounds like a really good system but it seems that a bit more thought should have gone into it, no? Or at least the explanation could be clearer.
    Ciao.
    (Another question) Can the original post (this one) get marked as helpful also? Imagine  earning points for posting :-)

    Howdy GeoCo et al
    I sort of agree with this new "Helpie-ette" deal. I wonder why while at this portion of the UX they didn't address the ongoing issue of the "irrevocable nature " of the OP awards of the traditional Green Stamp and Gold Star - I have made the mistake (once) but I see the silliest things marked Solved frequently. THAT is bad for business in that it gives false visual info and false statistical results.
    We'll see... BTW, the [People] TAB itself is the only new thing (the CONTROL in the TAB bar) - the URL has always been alive and well if one knew to add " /people "

  • Google maps and google help not loading anymore! help!

    Google maps and google help aren't loading since I've updated firefox. Works in Chrome no problem. Tried everything listed here: https://support.mozilla.com/en-US/kb/Error%20loading%20web%20sites, re-installed flash, cleared cache, etc... what am I missing?

    Anyone have any ideas?

  • Upgrading to xcode and can't connect to the network

    Hi! I use a C++ library in my application which connects to the network (I suppose it uses sockets). I've been using it for months and I was using xcode 3.2.4. Now, I just had the great idea of upgrading to xcode 3.2.5, and I found out my application was crashing with the error:
    If you are encountering this problem running a simulator binary within gdb, make sure you 'set start-with-shell off' first. 3.2.5
    Ok, couldn't solve it, so went back to 3.2.4, as suggested somewhere. The application is not crashing anymore, but now the library can't connect anymore to the network. Tried to rebuild it (I didn't write the library but I have the sources) and use the new library, but nothing. Still the library can't connect to the network. I tried with every simulator.
    Any idea what there could be wrong and how I may be able to solve this? Can I somehow delete manually everything related to xcode and the simulator and try to start all over again?
    Thanks!

    I've been able to temporarily solve this problem by removing the entire Development directory and installing again xcode 3.2.4. Even with xcode 3.2.4 however, the same happened, and I had to do this procedure again. Now it seems to be working correctly, but it seems something very strange has happened. Hasn't anyone experienced anything similar?
    Thanks!

Maybe you are looking for

  • How to migrate win 8.1 from sata hard disk to ssd

    I brought an Intel SSD 730 480GB 5GBs Sata 3 I also brought  a RAID CARD SYBA| SYPEX40039 bootable. attached the ssd to that. I like to migrate the Windows volume to the SSD.  but I have trouble to get the boot manager on to the ssd. despite not usin

  • Loading a BLOB to a table, using webutil

    Is there somewhere I can see a comprehensive example of loading a BLOB to a table, using webutil. That is where the user browses and selects a picture (or whatever) from the client machine, and then the file is loaded to the database. Thanks, Wayne

  • Adobe pdf document's help

    Hi    when ever i try to open a adobe pdf document's i get there is a problem with adobe acrobat/reader.please exit adobe acrobat/reader and try again. i do with no luck. i tryed to uninstall/reinstall my adobe reader 9.3.1 still will not open adobe

  • Will keywords applied in bridge be visible automatically in lightroom 5?

    If I create and apply keywords in Bridge, will they automatically be visible in Lightroom 5? I am using Creative Cloud. Rich G

  • How to Port Slideshow from PSE9 to PRE11

    I currently have installed and successfully used PSE9 for a number of years. I recently purchased and installed PRE11 in order to do some video editing however I first created a slideshow in PSE9 with the intent to burn it to a DVD. The completed sli