Help buttons Applescript studio

Hi everyone!
Well I learned a lot about the help menus since my last post:
http://discussions.apple.com/thread.jspa?threadID=686085&tstart=0
But I'm still stuck trying to get the help buttons that I installed on my interface to work. Specifically calling the help book is my problem. So if I have this connection in my script:
on clicked theObject
if name of theObject = "help button" then
-- here's where I want to call my help book to open in help viewer
end if
end clicked
I know there must be a simple command to open it, but all the documentation that I read it's not using the Applescript commands. The only "success" I've had is using some of these commands:
http://developer.apple.com/documentation/Carbon/Conceptual/ProvidingUserAssitApp leHelp/appendixb/chapter_7_section_1.html#//appleref/doc/uid/TP30000903-CH210-BGBBGBDC
But even if I can get it to work the viewer opens first the main Mac help page and then switches to my page. Sometimes it even shows my page with "Mac Help" as the title??? I know there's a simple command to this I just can't figure out what it is? Thanks in advance for your help!
Reg

I got it working!!! But some feedback would be great because here's what happened:
I started a brand new AS application just to check out the settings on a new project and I noticed that if I clicked the help menu it would display a dialog saying no help available. Now I didn't remember having that in my app and sure enough I was right. The difference is I started with a droplet form and I had to add in the help menu because the standard menu on a droplet doesn't have anything. But this added-in help menu that I put didn't display a dialog like the standard menu from the application template. And there is no help menu in the cocoa palette, you must just insert a menu item and make it into help. So I just copied the entire menu from the application template into my app and it worked right away! That's great but I just don't get exactly what the problem was? And hopefully not everyone that starts with a droplet template has the same problem??? :D:D:D
Thanks...Reg

Similar Messages

  • Help files applescript studio

    Hi everyone!
    Ok I've read all the info and this should be something pretty easy (I think), but for some reason I'm not getting it. Here's what I did:
    1. Made an index.html page and put it in a folder named MyApp Help and put that folder in MyApp bundle>Contents>Resources>English.lproj folder.
    2. Put header in the index.html file like this: <meta name="AppleTitle" content="MyApp Help">
    3. Added 2 strings in the info.plist with the names CFBundleHelpBookFolder and CFBundleHelpBookName with both having the name MyApp Help as the input.
    4. Added the files into xcode groups and files.
    It seems based on what I read that this should be it? But still no help file. Right now it's possible not everything is linked properly in Interface Builder, but if I open the Help Viewer and go to Library it should be there now right? Any help would be appreciated thanks!
    Reg

    I got it working!!! But some feedback would be great because here's what happened:
    I started a brand new AS application just to check out the settings on a new project and I noticed that if I clicked the help menu it would display a dialog saying no help available. Now I didn't remember having that in my app and sure enough I was right. The difference is I started with a droplet form and I had to add in the help menu because the standard menu on a droplet doesn't have anything. But this added-in help menu that I put didn't display a dialog like the standard menu from the application template. And there is no help menu in the cocoa palette, you must just insert a menu item and make it into help. So I just copied the entire menu from the application template into my app and it worked right away! That's great but I just don't get exactly what the problem was? And hopefully not everyone that starts with a droplet template has the same problem??? :D:D:D
    Thanks...Reg

  • Help button question Applescript Studio

    Hi everyone!
    My help menu works just fine but to get my help button on the main window to work I set the default app for my file to Help Viewer. Then I script the open file command in Finder to open the file which is in my app bundle. It works fine and I was never able to get the cocoa command to open the help file to work with my button. My question is though I just realized that if I would click the help button multiple times it would open multiple windows of the same file in Help Viewer. That doesn't seem to be cool as I would hope it would realize the file is already open and not open the same file again? Any thoughts on how I can resolve this?
    If it helps here's a link to my past posts:
    http://discussions.apple.com/thread.jspa?threadID=693971&tstart=0
    Thanks for the help!
    Reg

    My help menu works just fine
    You don't say whether or not you changed the normal setup for the Help menu item to make it work "just fine"... Typically the help menu item has a connection in Interface Builder to the First Responder's showHelp: method. Assuming you did not change this, and this is what is working fine, then there's no reason that you can't also set up your help button to work in the same way (no AppleScript code would be needed).
    In Interface Builder...
    - First turn off the "on clicked" action for your help button in the AppleScript pane of the Inspector window (so clicking the button doesn't trigger any AppleScript code).
    - Then select your help button and <Control>-drag from the help button to the "First Responder" icon in the "MainMenu.nib" window. As you're dragging you'll see a blue line following the mouse.
    - Release the mouse button once the line goes from your button to the First Responder and you see a blue square surrounding the "First Responder" icon. This will cause the "Target/Action" pane to open in IB's Inspector window and you will see a long list of "Actions for First Responder".
    - Scroll down and highlight the "showHelp:" method then click the "Connect" button. A little circle will appear next to the "showHelp:" item indicating the connection has been made.
    - Save your nib file and rebuild your app.
    Now when you click on your help button it will do a Cocoa call to the First Responder's showHelp: method allowing it to work just like the help menu item.
    Steve

  • 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

  • Applescript Studio - Dynamically named button title

    Can anyone tell me if it is possible to retrieve the title of a button in an Applescript Studio application?
    I have no problem if the title of the button is set in the Attributes Inspector.
    EXAMPLE:
    If I set the title of a button to "test" in the attributes inspector and attach a script to a button like:
    *display dialog (get title of button "btnName" of window 1)*
    the result will be a dialog containing the text "test"
    However, if I set the title of a button through a script like
    *set title of button "btnName" of window 1 to "test"*
    and then try to retrieve it the same way
    *display dialog (get title of button "btnName" of window 1)*
    the dialog is empty
    Does anyone know if it is possible to retrieve these dynamically set button titles?

    The name of the button has an applescript name, which is how I reference it from the script. But, the actual project uses a series of buttons which all have their titles set dynamically from a script. Also the mode of the buttons are set to "On Off" (not that I think that should make a difference) I am running leopard 10.5 with xcode 3.0.
    I'm rather new to Applescript Studio and xcode. I don't know what would be wrong with the set-up. And why I would have no problem setting the button titles from a script but not be able to retrieve them.
    I have come up with a work around, keeping track of the button titles in a separate array. I seems stupid to have to do that rather than access the existing button property, but it does work.
    I will have to set up a simple test to explore what may be going wrong.

  • Create a tab view item in obj-c for use in applescript studio

    I'm making an application with applescript studio. I want to be able to add tab view items to a tab view at the press of a button. The problem I have is applescript studio doesn't allow me to create a new tab view item. So I'm thinking I can create the tab view item using objective-c, pass that to my applescript, then add it to my tab view.
    In applescript I plan to use the following call methods to first create the tab view item object, and then add it to my tab view. The objective-c code which is called from the first line in the applescript code is below that. When I run my code I'm getting an error saying newTVI is not defined... so maybe you can see my error! Be kind to me because I'm new to objective-c and I'm sure that's where my problem lies. Anyway, I'd appreciate any help.
    ==Applescript calls to create and add a new tab view item
    set newTVI to call method "returnNewTabViewItem" of class "makeNewTabViewItem"
    call method "addTabViewItem:" of objMainTV with parameter newTVI
    ==Objective-c code to create the tab view item
    ==makeNewTabViewItem.h==
    #import <Cocoa/Cocoa.h>
    @interface makeNewTabViewItem : NSTabViewItem
    NSTabViewItem *newTVI;
    -(NSTabViewItem *)returnNewTabViewItem;
    @end
    == makeNewTabViewItem.m==
    #import "makeNewTabViewItem.h"
    @implementation makeNewTabViewItem
    -(NSTabViewItem *)returnNewTabViewItem
    newTVI = [[[NSTabViewItem alloc] initWithIdentifier:nil] autorelease];
    return newTVI;
    @end

    Please, any ideas?

  • Display alert applescript studio

    Hi everyone!
    I have used before display alert with default button and alternate button and now I would like to add a third button to my alert. I see there is a possibility of "other button" only it stretches out my alert and puts the third button away from the other two. Is there any other possibilities of adding a third button side by side to the other two? Any help is appreciated!
    Thanks,
    Reg

    display dialog can only handle three buttons, and you don't have any control over the formatting/placement:
    display dialog "blah" buttons {"1", "2", "3"}
    If that doesn't work for you, and since you're in AppleScript Studio, just use Interface Builder to create your own alert window with whatever buttons you like.

  • Create UI elements dynamically in AppleScript Studio?

    I'd like to create an applescript studio app that can create UI elements (radio buttons, checkboxes, etc) dynamically based on certain other criteria. I've been writing applescripts for a while but am somewhat new to applescript studio, so I don't know where to look for this, other than here. Any help would be greatly appreciated.

    that's what I thought. Unfortunately I'd like to have the ability to have no prior knowledge of what UI elements are needed, and call them into being at any time. So I'm gonna infer that that just isn't possible.
    Related question: can I set up a UI element, let's say a checkbox, and dynamically tell the UI element how many checkboxes I need and what their names/values should be? Or once again do I need to have prior knowlege of how many checkboxes I need?

  • Newbie help with sample Studio app. "Plain Text Editor"

    I'm trying to make the jump from AppleScript to AppleScript Studio, and because I want to eventually write a document producing application I thought I'd start with the textbook example "Plain Text Editor" included with Xcode. I think I see how menu items are connected to "Target/Actions," and I was able to build and run it without difficulty. It's remarkable how little AppleScript had to be written to produce a rudamentary text editor. But in playing with the built application, I noticed that the Revert menu item does not work exactly as expected.
    If you create a text document, and then make some change to it, and then click the Revert menu item, you get the expected little dialog asking if you want to revert to the most recently saved version, but if you then click the Revert button, the text displayed in the text view object does not revert to the original. However, something is happening, because whatever code is behind the Save, Close, and Quit menu items does seem to be "aware" that the Revert item has been invoked: because if you click one of these after Revert, the "do you want to save changes?" warning doesn't appear, just as one might expect.
    The Revert menu item seems to be connected to a "Target/Action" called "revertDocumentToSaved:" which sounds perfectly reasonable. But does the fact that Revert doesn't cause the displayed editing text to revert mean that (a) there is a bug in the code behind this Target/Action, or (b) that the writer of this textbook example just didn't bother to do everything needed for the Revert item to work in an intuitive manner?
    Whichever the answer, what would I do to make it work properely?
    It seems like there must be some sort of connection between the text view object in the editing window, and the Close, Save, Quit suite of menu items, because the behavior of these is dependant on whether or not there are unsaved changes in the text view object. But looking through the Inspector for this object, I don't see any, neither AppleScripts, nor Outlets, nor Target/Actions. Where and for what should I be looking?
    Dual 1.2 GHz   Mac OS X (10.4.8)  
    Dual 1.2 GHz   Mac OS X (10.4.8)  

    I think -- and I'm sure someone will correct me if I'm wrong -- that this is a place where AppleScript Studio's implementation just isn't done right. Either they intended to add a "revert" handler somewhere and forgot, or else they meant to have it send an existing message and didn't.
    I haven't done any document-based applications -- heck, I've only dabbled slightly in AppleScript Studio -- so there may be a "deeper" answer to this, but you might consider just hooking the menu item up to send its "choose menu item" handler to your document script, and have it react accordingly.

  • Starting an applescript studio app

    I have written an applescript. I want to incorporate it into an applescript studio app........mainly to make use of the progress bar indicator. How do I get the script to start without having to click on any buttons. Thanks.

    Hook up your window (or the progress indicator) to the "awake from nib" handler in Interface Builder and insert your existing applescript code into the "on awake from nib theObject" handler that gets created in the AS Studio script.
    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.

  • Drag & drop from sorted table view to outline view in AppleScript Studio

    I want to make a drag and drop from a sorted table view to an outline view in applescript Studio.
    Problem is that the data are copied from the data source of the table view,
    wich is unsorted, rather than from the table view itself that is sorted.
    So I have the wrong data droped.
    The element wich is passed from the table view thru the outline view is the row number. Then the script find the data of the corresponding row of the data source of the table view(unsorted).
    I want the script, using the row number, to get the content of the displayed row of the table view (sorted).
    Any help welcome.

    I want to make a drag and drop from a sorted table view to an outline view in applescript Studio.
    Problem is that the data are copied from the data source of the table view,
    wich is unsorted, rather than from the table view itself that is sorted.
    So I have the wrong data droped.
    The element wich is passed from the table view thru the outline view is the row number. Then the script find the data of the corresponding row of the data source of the table view(unsorted).
    I want the script, using the row number, to get the content of the displayed row of the table view (sorted).
    Any help welcome.

  • AppleScript Studio: status bar and panel window

    My problem is that the panel won't open, and so I don't see the progress bar.
    All I am looking for is the panel to come down, show the progress bar turning, then for the panel to go away when iCal is done adding the event. This is the entire script, but I'm not sure I have everything right in Interface builder. The Documentation for display mentioned clicking panel ended, but then further down it looked like you didn't need it.
    I'm confused.
    -- +Event.applescript
    -- +Event
    -- Created by Michael Ewald on 6/26/06.
    -- Copyright 2006 Michael Ewald. All rights reserved.
    load panel "statusPanel" from nib "statusPanel"
    on clicked theObject
    -- Get & Format form items
    set eventTitle to contents of text field "eventTitle" of window "main" as string
    set eventLocation to contents of text field "eventLocation" of window "main" as string
    set EventNotes to contents of text view "eventNotesText" of scroll view "eventNotesScroll" of window "main"
    set allDay to state of button "allDay" of window "main"
    set startDate to current date
    set startDate to content of control "startDate" of window "main"
    set endDate to content of control "endDate" of window "main"
    -- Make Event
    start progress indicator "statusBar" of window "statusPanel"
    try
    start progress indicator "statusBar" of window "statusPanel"
    display "statusPanel" attached to window "main"
    tell application "iCal"
    set theCalName to "AppleScript Test"
    set theCal to calendar theCalName
    if allDay is equal to 1 then
    make new event at end of calendar theCalName with properties {summary:eventTitle, location:eventLocation, allday event:true, description:EventNotes}
    else if allDay is equal to 0 then
    make new event at end of calendar theCalName with properties {summary:eventTitle, location:eventLocation, start date:startDate, end date:endDate, description:EventNotes}
    end if
    end tell
    -- reset form
    set the contents of text field "eventTitle" of window "main" to ""
    set the contents of text field "eventLocation" of window "main" to ""
    set contents of text view "eventNotesText" of scroll view "eventNotesScroll" of window "main" to ""
    set state of button "allDay" of window "main" to 0
    set currentDate to current date
    set currentDatePlus to (current date) + 1 * hours
    -- Update Times
    set content of control "startDate" of window "main" to currentDate
    set content of control "endDate" of window "main" to currentDatePlus
    on error
    display alert "There was a problem!"
    end try
    close panel "statusPanel"
    end clicked
    ----

    Thanks for the response,
    right now the window is in a seperate nib file. I was
    trying to follow the applescript studio example
    "Display Panel"
    Then you need to load it, look at the example, you see panelWIndow is declared as property:
    property panelWIndow : missing value
    then inside on click handler:
    if panelWIndow is equal to missing value then
    load nib "statusPanel" -- if your nib is statusPanel.nib
    set panelWIndow to window "statusPanel" --> that's AppleScript window name
    end if
    then you can use:
    display panel panelWIndow attached to window "main"
    What is the advantage / disadvantage of having more
    than one nib file?
    Not a whole lot in simple app, because you have to load it to use it.
    But in more complex apps, the advantage is that you don't commit run time memory, if the users don't use it.

  • Applescript studio app and plist???

    Hi everyone!
    If I have an Applescript studio app and I don't write anything to a plist is it still possible the app will make it's own plist for any reason? Seems to be but I can't tell for sure because seems not to be consistent. Any help would be great!
    Thanks,
    Reg

    On second thought, the plist file might be created if
    you display something. I just did a clean install so
    everything's new. Let me check with one of the apps
    that displays a an open dialog or something.
    Yes there are certain things in AS Studio that will write to a plist file. One example I know of is if you give any of your windows an "Auto Save Name" (in the "Attribute" pane of IB's inspector pane). The "Auto Save Name" will be used as the key to a plist entry that auto-saves the window's size and position on screen. When you re-run your app the window will be opened with the size and location stored in the plist.
    I believe kel may also be correct that if your app displays an open or save dialog then some state information about those dialogs will be saved to your plist.
    You can always use "plutil" to convert the plist file from binary to xml and then display the contents to see what's in there...
    <pre>
    plutil -convert xml1 /path/to/file.plist
    cat /path/to/file.plist
    </pre>
    Steve

  • Applescript Studio Problems, Web Browser

    Hey,
    I'm attempting an application using Applescript in Xcode because I just can't get my head around objective-c.
    So far I have a GUI with a button and a webview both linked to this code:
    on clicked (theObject)
    if the name of theObject is "loadgoogle" then
    tell mainwindow
    open location "http://google.com"
    end tell
    end if
    end clicked
    It compiles fine but when I click the button nothing happens.
    Could someone please enlighten me?
    Kind Regards
    Message was edited by: maximart4u

    Are you really using *AppleScript Studio*, or are you just dropping the old handlers into a new AppleScriptObjC project?
    If you are creating a new project, note that AppleScript Studio is deprecated in Snow Leopard. You can still edit existing AppleScript Studio projects (which explains why it compiles), but your on clicked handler does not meet the new naming protocol used in AppleScriptObjC and Interface Builder.
    See the AppleScriptObjC Release Notes - it has information about enabling the AppleScript Studio palette in Interface Builder (the AppleScript Studio project templates have been removed, though). There is also a AppleScriptObjC in Xcode tutorial at MacScripter that should get you started.

Maybe you are looking for

  • How to write REF-CURSOR Query in Oracle Reports

    Hello Guys!! I have a form in which you can select regions/divisions/locations etc by the use of check boxes. And the selected values will be inserted into a table, and based on the selected values of the table the report is run. The issue I have is

  • Max no. of line items reached in FI

    Hi Everyone, My client does billing through a batch job and the program used SDBILL which is assigned to TCode VF04 in Table TSTC. There are invoices where the line items is fixed at 999.Could somone please tell me how to automatically split invoices

  • Check Numbers with DME file

    The bank requires XML file that contains check numbers. Since we are using new payment medium workbench and DME tree, then how do we input check numbers as there is no place to enter check numbers when maintaining variant in OBPM4.

  • HT1498 Can not rent movies on Apple TV

         The apple tv is connected to Wifi but renting a movie doesn't appear as an option.  We've tried turing the apple tv off but it still will not work.  Any suggestions.

  • Comparing JSP ,PHP AND ASP

    Hello Can you send me few reasons why is JSP better then ASP nad PHP. Thanks Jelena