Applescript Studio/Xcode Tutorials

I'm a big applescripter, and just recently i learned about applescript studio in xcode. I downloaded xcode 3.2.6 and started having fun, but immediately found i was limited by obj-C (i know precious little). So i've been searching for a good bunch of applescript studio/xcode tutorials, but everything i find is for an older version of xcode! If any of you have seen anything for xcode 3.2.6, it would be greatly appreciated!

AppleScript Studio is the old framework, and is deprecated in Snow Leopard (you can still use it if you really want to, though).  AppleScriptObjC is the new framework, and although you don't need to know Objective-C, it helps a bit to be able to read it, since most of the Cocoa documentation uses it (since ASOC calls Cocoa methods directly, Apple expects you to just use the existing documentation).
There is an AppleScriptObjC in Xcode tutorial at MacScripter, and Shane Stanley has an excellent e-book available at Mac OS X Automation that will get you up to speed fairly quickly - definitely worth the investment.
I also have a few example projects and references on my AppleScriptObjC web page that have been gathered from my various wanderings (there are also a couple of conversion examples from AS Studio and Obj-C).

Similar Messages

  • AppleScript Studio/Xcode problem - Problem with text entries! Please help!

    Hey, I've been up for hours each night looking for solutions to this but still have had no luck.
    I am creating an app in Xcode/Applescript studio that will ask you to enter how many times you would like system events to repeat a certain keystroke. First of all, the code would look something like this:
    on click theObject
    If the name of theObject is equal to "myApplication" then
    (Right here would be where the variables representing text in an input in the app's window would be, which I have absolutely no clue what to type.)
    tell application "text edit"
    activate
    tell application "system events"
    keystroke x (x representing a variable)
    end tell
    end tell
    end clicked
    and that's about as far as I can get. I want a variable representing the text in the main text entry box, but I have no clue how to access that text, or even know if it's submitted or detected when I hit a button. Hopefully you're following, as I am way to confused to fully explain it, but please try and help me out if you can.

    Hi Kamprath445,
    Though this mentions iTunes, I think it has good examples you can use...
    http://dougscripts.com/itunes/itinfo/keycodes.php
    More in depth...
    http://developer.apple.com/documentation/applescript/conceptual/applescriptlangg uide/conceptual/ASLR_variables.html

  • Building a Universal Binary in Applescript Studio (Xcode 3.1)

    Hello all,
    I've been trying to configure Xcode 3.1 to build a UB of my applescript application, but I cant figure it out.
    People tell me it doesn't even open on 10.4 or PPC macs (I have no way of testing it).
    I've been going through the documentation for 2 days but I don't know what I'm missing for the life of me.
    Can anyone help please?
    Thanks in advance.

    See my answer in your other thread.
    http://discussions.apple.com/thread.jspa?threadID=1844943&tstart=0
    Eric

  • Applescript Studio/XCode - NSPathControl to POSIX file with spaces

    I'm trying to get a value from a NSPathControl in my XIB and change it into a POSIX file, so I can manipulate it in the Finder (make a copy, rename, etc). My code works, but not if there are any spaces in the path. Any spaces are returned as %20, which doesn't translate into a POSIX file. Any ideas?
    script:
    on clicked theObject
    set theFile to (string value of control "sourceXML" of window "main")
    set theFile to (theFile as POSIX file)
    tell application "Finder"
    reveal theFile
    end tell
    end clicked

    Hello
    Since you're using AS Studio, you may use NSString's method to convert %xx notation to character.
    Something like this :
    on clicked theObject
    set f to string value of control "sourceXML" of window "main"
    set f to call method "stringWithString:" of class "NSString" with parameter f
    set f to call method "stringByReplacingPercentEscapesUsingEncoding:" of f with parameter 10
    set f to (f as POSIX file)
    tell application "Finder"
    reveal f
    end tell
    end clicked
    String Encodings constants are as follows. (See NSString's reference for detalis.)
    (I think 10 = NSUnicodeStringEncoding will be fine, but I may be wrong.)
    enum {
    NSASCIIStringEncoding =1,
    NSNEXTSTEPStringEncoding =2,
    NSJapaneseEUCStringEncoding =3,
    NSUTF8StringEncoding =4,
    NSISOLatin1StringEncoding =5,
    NSSymbolStringEncoding =6,
    NSNonLossyASCIIStringEncoding =7,
    NSShiftJISStringEncoding =8,
    NSISOLatin2StringEncoding =9,
    NSUnicodeStringEncoding =10,
    NSWindowsCP1251StringEncoding =11,
    NSWindowsCP1252StringEncoding =12,
    NSWindowsCP1253StringEncoding =13,
    NSWindowsCP1254StringEncoding =14,
    NSWindowsCP1250StringEncoding =15,
    NSISO2022JPStringEncoding =21,
    NSMacOSRomanStringEncoding =30,
    NSUTF16BigEndianStringEncoding =0x90000100,
    NSUTF16LittleEndianStringEncoding =0x94000100,
    NSUTF32StringEncoding =0x8c000100,
    NSUTF32BigEndianStringEncoding =0x98000100,
    NSUTF32LittleEndianStringEncoding =0x9c000100,
    NSProprietaryStringEncoding =65536
    Hope this helps,
    H

  • AppleScript Studio in Xcode 4.0.1

    I know in Xcode 3.2 (or earlier) you could enable it (AppleScript Studio) with the Terminal command
    defaults write com.apple.InterfaceBuilder3 IBEnableAppleScriptStudioSupport -bool YES
    but now that Interface Builder is gone, How can you enable it? Or is it impossible with the new Xcode.
    I guess I could use my old Xcode to work on these types of apps, but it would be nice to be able to use this...
    Thanks,
    kylerjt

    AppleScript Studio is deprecated. I believe all your old apps will work, but you'll have to make the move to AppleScriptObjC for any new apps you write. I never used Studio, but I understand ObjC is a much better way of getting things done.

  • Applescript Studio Ad Builder Demo

    Apple distributed a CD for Applescript with a demo for InDesign 2.0 called Ad Builder. Is there an updated demo for CS2 sytax?? It built Real Estate pages..

    Hi--
    AppleScript Studio uses Xcode for creating, editing, and compiling applications, and Interface Builder is for building the GUI part. I'd suggest taking a look at the Apple Developer Connection web site.
    In particular, there's an introduction to AppleScript Studio that may or not explain it all to you. There are even some tutorials there on building apps and gheir GUIs.
    charlie

  • AppleScript Studio Quit Working

    Last December (2007) I followed the tutorials in the "Introduction to AppleScript Studio Programming Guide" to create a handful of demo projects, plus one of my own invention that actually worked!
    Today I sat down to resume my learning and I found that, while the target apps I had created still work, I cannot rebuild the projects. The error message is the same in every case:
    Tool:0: Command /usr/bin/gcc-4.0 failed with exit code 1
    Tool:0: /System/Library/Frameworks/WebKit.framework/Versions/A/WebKit
    load command 19 unknown cmd field
    To reproduce the error, I...
    Open the project's folder
    Double-click on the <projectname>.xcodeproj icon
    Click the "Build and Go" button.
    Any idea what may have changed since last December?
    --Gil

    I just encountered a problem with my project that occurs under the same circumstances: open my project file, click on the build button, and it fails with the same error:
    /usr/bin/ld: /System/Library/Frameworks/WebKit.framework/WebKit load command 19 unknown cmd field
    collect2: ld returned 1 exit status
    I just ran an update to move to 10.4.11. I get the feeling that updated Webkit, and that's causing the problem. I'm on a PPC machine running XCode 2.1 but perhaps it's time to check out 2.5.
    For what it's worth, I found that I was still able to compile using "xcodebuild" on the command line. You might try giving this a shot. From the Terminal, cd into the project's directory; then execute "xcodebuild -alltargets clean && xcodebuild build" -- this will clean the current executable then build it.
    A couple questions for you: (1) What OS are you running? (2) What version of XCode? (3) What processor architecture (Intel or PPC)?
    That's all for now.. let me know how it goes..
    On a side note, I found your post through a Google search, and it's only a day and a half old... nice.
    (Update -- Ah... I see you solved the problem by upgrading to XCode 2.5.)
    Message was edited by: Krishen

  • Question regarding definition "Applescript in Xcode"

    Hello, I've got a question:
    How would you define Applescript in Xcode 3.1.2? Is one making an app with Cocoa? Is it called Applescript Studio or Cocoa Applescript?
    Thanks in advanced

    AppleScript in XCode is generally known as AppleScriptObjC (AppleScript/Objective C). More details as Apple's Developer Site.
    As a categorization, 'pure' AppleScript is generally perceived as a high-level scripting language (generally used on top of other processes that do the work. AppleScriptObjC is more of a high-level programming language since you can develop full-blown standalone applications.

  • Applescript (in Xcode): set text in label (in window) to .....

    Hello,
    How do you change the text of a label (in a window) in Xcode, with AppleScript?
    I use Xcode, but inside my app I use Xcode. Applescript studio actually, only it's isn't called like that anymore.
    It's also called applescriptobjc...
    Example:
    I have a label, containing the text "Hello" in my main window.
    Next to it, is a button. I want that button connected to an applescript action, like:
    on thebuttonclicked_(aNotification)
    set thelabel1 to "Bye!"
    end thebuttonclicked_
    Please help,
    Isaiah v. Hunen
    P.S. Is there a way to also use the text of the label, like;
    on thebuttonclicked_(aNotification)
    display dialog thelabel1
    end thebuttonclicked_

    AppleScript Studio was deprecated in Snow Leopard - the new framework (AppleScriptObjC) is quite a bit different.  One of the main differences is the way that user interface objects are referred to.
    Typically, in your project you would create an outlet property for the label and connect that to the UI item.  This outlet would then be used with the desired NSTextField methods (a label is just a text field that looks a little different).
    property theLabel1 : missing value -- connect to the label text field
    on thebuttonclicked_(aNotification)
      theLabel1's setStringValue_("Bye!")
      display dialog theLabel1's stringValue() as text
    end thebuttonclicked_
    Bindings can also be used to bind the value of the text field to a property.

  • How can I use AppleScript Studio to display an image

    How can I use AppleScript Studio to display an image in a dialog?

    Add an image well to your window in Interface Builder.
    You can also add an image file to the Resources group of your Xcode project and then set the image to be displayed inside the image well directly in Interface Builder. No AppleScript code is needed if the image is contained within your app bundle and can be set ahead of time like this.
    If the image is contained in your app's bundle but you need to set or change the image at run time then you can use a line of AppleScript to load it into the image well using just it's filename:
    set image of image view "yourImageView" of window "yourWindow" to load image "YourImageFile.jpg"
    If you need to load an image from an arbitrary location outside your app's bundle then use a path to the image file...
    set image of image view "yourImageView" of window "yourWindow" to load image "/path/to/YourImageFile.jpg"
    Steve

  • Applescript using XCODE 3.1.1 memory leak?

    Does anyone know about a memory leak in applescript applications. I've written an application which displays images. It appears to retain each displayed image in memory untill it finally hangs. Does anybody know if this is new in 3.1.1 as I don't remember it happening with 3.0.0 ?
    If anybody knows how to release it please let me know.
    Thanks JS.

    Take a look at the discussion section and sample code below it in the docs for the "load image" command in the AppleScript Studio Terminology Reference. Loaded images are indeed retained, but supposedly can be deleted when you're done with them.
    This doesn't appear to be new in Xcode 3.1.1 though.
    Steve

  • Option+Return does not work in applescript studio

    Fresh install of osx 10.4.6 Tiger, newest release of xcode.
    I start an applescript studio application project, when editing in Xcode Option+Return does not insert the continue line character.
    I can open the same .applescript in the Applescript Editor and Option+Return does work.
    Also, Option+Return works in my desktop installation of Xcode. No idea what's different here or how to fix it, but it's really messing with my work flow.

    Moved to .NET SDK forum.
    Search here, lots of post on IIS and setting Printer Access Permissions for your application.
    Also search MSDN on what is required to for IIS to access local Printers.
    Also search for ActiveX Controls and Browser permissions, you'll likely have problems there also since most Browsers will not or do not recommend allowing any ActiveX control.
    Don

  • Installing Applescript Studio

    Hi,
    Where can I get AppleScript Studio? I can't find it preinstalled on my Mac Mini, nor on the MacOS X double CD. Is there some place I can download it without needing to get the full XCode or Dev Tools?
    Thanks!
    Raph

    AppleScript Studio is not a separate "tool"... it's more or less just a different type of project that you can create and build in Xcode. So you'll use Xcode for creating your AS Studio source files and building your product and you'll use Interface Builder for creating your user interface and connecting the objects in your interface to the AppleScript handlers that they trigger.
    I suppose it does seem like a big download if you are under the impression that AS Studio is just an extension of plain vanilla AppleScript. But in some ways AS Studio is almost more like an extension of Cocoa. An AS Studio app can make use of most or all of the user interface items that Cocoa can use and it can control/interrogate those items using handlers and properties that AS Studio provides. In addition, through the use of AS Studio's "call method" you can make direct calls to Cocoa methods to perform actions that AS Studio doesn't provide out of the box.
    Steve

  • Need applescript studio older version

    I have been asked to program for a company. what I would like to do is go back to an older version of Applescript studio what actually uses Applescript so I can create on interface with drop down windows and that cool floating gray-ish window. I dont know Obj-C.
    what version of AS would that be. thanks for the info.

    AppleScript is a set of system components, so you can't just drop in an older set.
    AppleScriptObjC does use AppleScript, the main difference is in the way it accesses the Cocoa frameworks - AppleScript Studio essentially uses a bunch of terminology and handler wrappers around Cocoa methods that the Studio development team have gotten around to including, while ASOC can call Cocoa methods directly (a bit cleaner than Studio's call method kludge). You don't really need to know Objective C, but it does help a little when looking at the documentation - I know just enough to get an idea what some code snippet is doing, but don't ask me much more than that.
    Older AppleScript Studio projects can still be edited and compiled in Snow Leopard's Xcode, so the components are still in there. Since Apple wants everyone to start using the new framework, the older project templates have been removed, but they can also still be used. If you really need to develop a new Studio application, for example to use on older systems, you just need to do a couple of things.
    1) The AppleScript Studio palette can be enabled in Interface Builder by using defaults write com.apple.InterfaceBuilder3 IBEnableAppleScriptStudioSupport -bool YES
    2) You need to get a copy of an AppleScript Studio project template. If you have access to a Leopard system installation, the easiest way would be to make a copy of the desired template from the */Developer/Library/Xcode/Project Templates/Application* folder there, for example the *AppleScript Application* template (you can also download the old templates from my iDisk here). You probably shouldn't modify anything in the /Developer folder, but you can use custom project templates from your user's *~/Library/Application Support/Developer/Shared/Xcode/Project Templates/Application* folder, so copy your project template there (make intermediate folders as needed).
    Once the template is copied, you can select it when making a new project and use the old terminology as usual.

  • AppleScript Studio projects under Snow Leopard

    I know Apple has depreciated AppleScript Studio, but the documents say old projects can still be used, so I assume there's a way to edit my old AS projects. I have the iPhone SDK with Xcode 3.2 and Interface Builder, but it doesn't recognize my AS project files (e.g., MyProject.pbproj). How do I get Xcode to open my old AppleScript Studio project files?

    The old .pbproj projects will probably need to be converted or opened in an older version of Xcode, which can be downloaded from Apple's Developer Member Site. The newer .xcodeproj AppleScript Studio projects can still be used in Snow Leopard (it is just not recommended), so if you have an existing project you can enable the AppleScript tab in Interface Builder - see the AppleScriptObjC Release Notes.

Maybe you are looking for

  • AE_DETAILS_GET_ERROR (File to File)

    Hi, I am doing File-to-File scenario, and I am not using BPM. I am getting the following error in "Call Adapter": <b><?xml version="1.0" encoding="UTF-8" standalone="yes" ?> - <!--  Call Adapter   --> - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Mess

  • Rendering PDF in flex

    Hi all, I have a task of rendering a PDF in the screen. Could anyone please help me out in this aspect. Is there a way for rendering PDF into a component in flex. Thanks, AMAR

  • HR data extractor

    hi guys , can any one tell me how can we extract  the HR data sourse and how is will come to bw side is there any special extractors apart tables ,views and function module cheers dp

  • Adobe reader interactive services detection

    Rolled out an Adobe Flash player update on 100 PCs and 5 of them are now reporting this message: Interactive Services Detection - a program on this computer is trying to display a message. Product:Adobe Flash Player 16 ActiveX - - Error 1704. An inst

  • Help needed with EXIT_SAPLMDR1_005 for rounding

    Hi Guru's, We have an issue with the user exit EXIT_SAPLMDR1_005 in ECC6 system as it isn't being triggered. We've recently performed an SAP upgrade from 4.7 to ECC6 and when creating a PO in the 4.7 system we've stuck a breakpoint at the customer fu