Slider -- How can I get NSSlider/NSControl properies directly?

I’m creating an AppleScript Studio application and I'm looking for a way to get and set the value of a slider via AppleScript. All the examples I've found simply explain how to target a text field with Interface Builder -- that perfectly simple. No problem there. I want to access the slider’s value property directly ... and omit the overhead of an additional text field.
Looks like the control’s data cell holds this value, but I don’t know how to call it -- not surprisingly, I’m having a little trouble understanding all the NSControl properties.
Thanks! John

I've read a good bit about AppleScript Studio, but I
haven't found a page that directly addresses this
simple fact. Part of my difficulty is my lack of OOP
background, so I'm having a bit of trouble
interpreting the class properties. It's probably
listed right there, huh. Where did you come across
this useful tidbit?
The AppleScript Studio Terminology Reference is one good place to look for info and examples. And remember to pay attention when you look at the info for a particular interface element to also look at the "Inherits from:" entry right at the top of the info. For example, when you look at the info for a "slider" you'll see that it inherits from a "control" (and a "control" inherits from a "view")... so a "slider" has all the properties listed under the slider section, but also all the properties listed for a "control" and for a "view", etc... on up the inheritance tree.
Presently, in "on clicked" handlers, I'm
distinguishing between button objects by their title.
As I have more than one slider in my main window, I
planned to do the same in "dragged" handlers ...
however IB's Inspector palette doesn't show a slider
name property!
Can I identify the object by it's AppleScript name?
If so, what's the syntax for that? (If indeed this is
possible, it sounds like a much more stable
connection that by referencing with "the title of the
object."
Yes you can definitely identify objects by their AppleScript name. And in my experience it's almost always easier to identify objects by their AppleScript name rather than by their "title". Some items may not have a title and in some cases (such as buttons) you may even want to change the title at runtime based on what's going on in your program. As you might suspect the property you want is "name". The syntax is like this:
<pre>
on clicked theObject
if name of theObject = "YourItemsAppleScriptName" then
-- do something
end if
end clicked
</pre>
Or
<pre>
on clicked theObject
set clickedItem to name of theObject
if clickedItem = "SomeAppleScriptName" then
-- do something
else if clickedItem = "SomeOtherAppleScriptName" then
-- do something else
end if
end clicked
</pre>
Steve

Similar Messages

  • How can I get i3 to properly do multihead?

    I'm trying to have i3 properly handle connecting a second display and having it utilized as a non-mirrored extra monitor per workspaces.
    Actually, I'd be happy with anything that doesn't just mirror the display. 
    I'm currently looking at using xrandr and maybe sxrandrd but I'm not sure whether or not what I'm trying to do is possible. Both the wiki and i3 documentation haven't quite provided the info I need. 
    TL;DR: Using i3. Sometimes I plug in an HDMI monitor. I'd like to use that monitor as an extra (non-mirrored) screen per workspace. Possible?
    Last edited by geosmin (2014-10-23 03:36:23)

    Works great.  I think.
    What do you mean "extra screen per workspace." ?  What happens is that a workspace is on one monitor or the other.  Containers move from monitor to monitor when they are moved to a workspace on that monitor.   In other words. workspaces 1-3 might be on the native monitor, and 4-6 might be on the HDMI monitor.  The main monitor will be displaying one of its workspace, and the HDMI monitor will display one of its workspaces.  If you are on workspace 1 (the main monitor), and you move to workspace 5, the cursor will leave the main monitor and  move to the HDMI monitor.  If workspace 5 was not being displayed , then 4 or 6 were.  Workspace 5 will be be brought to the front on the HDMI monitor, leaving workspace 1 on the main monitor.
    The right tool is xranr.   Are you sure you did not find what you needed in the i3 documentation article on multi monitors?
    Edit : Oh, are you using Nvidia?
    Last edited by ewaller (2014-10-23 03:49:26)

  • Illustrator is not picking up my shapes library, how can I get them syncing properly?

    I'm using my iphone 5s to take vector images and them which should then save them directly to my cloub library but I cant find them anywhere and there are no libraries showing at all in my illustrator CC. Any suggestions?

    For myself, I would like the 'shape' to be accessible on my iPhone, not the Cloud library. Then upload from the portable device onto the desktop via USB or iTune sync.
    My internet speed is far too slow to access the Cloud. Just launching Illustrator takes forever when connecting to the internet because all the jaja that wants to load infront of Illustrator. My Cloud library is 'unable to connect to server'.
    What a waist - to capture a photo on your phone and not being able to access it. Might as well just take a regular photo, import into Illustartor and trace it. It is the photo that I want, but I used the Adobe Shape app to 'lock' it from my use.

  • How can I get Firefox to go directly to home page and not to how to syn page as I do not want to syn anything

    whenever I now go to mozilla firefox, it opens the whats new, or how to syn ? I don't have anything to sync, just want to go to the Home page I selected

    Open a new window or tab. In the address bar, type '''''about:config'''''.
    If a warning screen comes up, press the '''''Be Careful''''' button.
    This is where Firefox finds information it needs to run.
    At the top of the screen is a search bar. Enter '''''browser.newtab.url'''''
    and press enter. '''''browser.newtab.url'''''
    tells Firefox what to show when a new tab is opened.
    If you want, right click and select '''''Modify'''''. You can change the
    setting to;<BR><BR>about:home (Firefox default home page),<BR>
    about:newtab (shows the sites most visited),<BR>
    about:blank (a blank page),<BR>
    or you can enter any web page you want.<BR><BR>
    The same instructions are used for the new window setting, listed as
    '''''browser.startup.homepage'''''.

  • How can I get bookmarks to open directly underneath the folder in the sidebar to save width space?

    Just reset Firefox(latest version) as it was running slowly, now much better but I had customized the bookmarks sidebar so that everything (folders, bookmarks) opened directly underneath each other rather than one step to the right. This saved space. This customisation has gone and I can't find how I did it as it was an answer somewhere at least a couple of years ago. Please help. Thanks

    You would have used code in the userChrome.css file to achieve this.
    Add code to the userChrome.css file below the default @namespace line.
    *http://kb.mozillazine.org/userChrome.css
    The customization files userChrome.css (user interface) and userContent.css (websites) are located in the chrome folder in the Firefox profile folder.
    *http://kb.mozillazine.org/Editing_configuration
    <pre><nowiki>@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */
    #bookmarksPanel treechildren::-moz-tree-indentation { width: 0px !important; }
    </nowiki></pre>

  • How can I get my 6700 to direct e-mail a scan with windows 8?

    I have a 6700 all in one and want to be able to e-mail a scanned document directly as I do at work?

    Hello @hammer263 , and welcome to the HP Forums.
    I understand you are looking into scan to email options.  I would like to help.
    I would recommend utilizing this document on How to Scan: Windows 8.  Refer to the section entitled scan to email.
    This should walk you through the setup.
    Good luck and please let me know the results of your troubleshooting steps. Thank you for posting on the HP Forums!
    Please click “Accept as Solution " if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the right to say “Thanks" for helping!
    Jamieson
    I work on behalf of HP
    "Remember, I'm pulling for you, we're all in this together!" - Red Green.

  • How can I get my network printer to print in color?

    I have a Dell 3110cn color printer on my network. Since I did the Maverick update the printer will no longer print in color only b&w. It's using a generic printer driver. I had no problems before the update. It's a great workhorse printer. How can I get this connected properly?

    Bruce777 solved this for me, thank you Bruce! My printer now works perfectly on my new wifi network!
    Bruce's  instructions, for anyone else having the same issue:
    - delete any previously set up printers
    - scrub old hp software and update software to get the hp 2.8 drivers
    - remove the usb cable from the printer if you have one connected
    - reset the printer network to hpsetup (hold down the power button and press network button 2x and then cancel 3x, release power button.)
    - print out the wireless network test report (hold down the network button and press the update button 2x). verify the network name / ssid is hsetup
    - got to sys prefs > network and change the mac wireless network to hpsetup
    - go to the sys pref > print scan
    - add the HP 8000 printer
    - click on the options and supplies button and click on the Show Printer Webpage
    - click on the networking tab > wireless in the left pane > start network wizard and change the network from hpsetup to your network
    - finish (this page may freeze up.  close the browser)
    - go back to the sys prefs and change the wireless network back to your networt
    - go to the printer and print out the wireless network test report (press network button and update button 2x).  Check that the SSID is your network
    - go to sys prefs > print scan > select your printer > options & supplies > show printer webpage > network info (check ssid and compare to wireless network test report)
    - try printing something to your printer.  It might take a little time the first print.

  • I'm getting a very low signal from my Blackbird interface. The fire wire connection is selected properly and track recording sliders set. However the recording level slider in the lower right corner is grayed out. How can I get better signal?

    I'm getting a very low signal from my Blackbird interface. The fire wire connection is selected properly and track recording sliders set. However the recording level slider in the lower right corner is grayed out. How can I get better signal?

    If it's slow on startup it would be extensions loading or LaunchDaemons starting up. 
    You should have a look in:
    /Library/LaunchDaemons
    /Library/Extensions
    You can count out anything in your home folder and it shouldn't put anything in /System as that's reserved for Apple. 

  • I imported a slide on my old mac book pro to my iTune i had on it, but it got a new one how can i get my old iTune  back with that slide i imported

    imported a slide on my old mac book pro to my iTune i had on it, but it got a new one how can i get my old iTune  back with that slide i imported

    If this is a question about syncing with iTunes, you might want to post it over in the iTunes forum.

  • How can I get iTunes Store to properly function on my windows 7 laptop? I have tried numerous things such as the MDos Promt, checked for firewall, checked for applications allowing iTunes to not be affected by anything. "Can't connect to network"

    How can I get my iTunes to function properly. It stopped working a couple of days ago and I can't figure how to get back and running. I have tried numerous things such as rebooting, checking for the network connection, applying it to open without security measures. Error message "Your connection time out. Check your connection." Even though I can get into the internet, iTunes is still not responding! Technical support help isn't helping!

    Just to close out ... the 'supervisor' was clueless as it turns out.  Apple does NOT have a deal with UPS on handling the Mini, so the person who gave me the info was wrong.  Did he call back?  No ... he just let me go out and find out myself.
    So I called again, and this time eventually ended up with a manager, who told me that the UPS Store thing wouldn't work, but that a box would arrive and then there would be a 'forced replacement'.
    About 10 minutes later he called back and said he discovered that EVERYTHING the supervisor did was wrong ... he didn't actually properly flag for auto-replace, so I would have gone through an identical cycle again!  So he had to restart the whole process, meaning I would get TWO 'coffins', but that I would then get an auto-replacement and would see that indicated in my support email.
    I got the email, saw 'auto-replace'.  Got the box on the 28th and immediately turned it around.  Apple got the box on the 31st, and on the 1st I got emails that my Mini would arrive on the 2nd and it also had the new serial #.
    Yesterday I grab the box from FedEx and go home to check it out.  As expected, it IMMEDIATELY worked on my WiFi without issue ... and has worked perfectly since.
    So ...
    - it was NOT my home network.
    - it WAS a hardware issue with the Mini
    - Apple does NOT do proper testing on the Mini to detect what appears to be a fairly common issue.
    - non-retail customers ARE treated as second-class by support.
    This issue took FOUR WEEKS to resolve, involved FOUR shipments back & forth, and the ONLY reason it got resolved was that *I* did the troubleshooting that Apple either would not or could not do.
    For someone who has been an Apple customer for more than 30 years, this has been a sobering experience ... I quite frankly expected much better from them.

  • When playing a slide show there are many nonvisible photos.  They appear as "image cannot be edited. The original is offline."  Where is it and how can I get it back into my photo library?

    How can I get all my images to show in my photo library?  When playing a slide show some of my photos have a message "Image Cannot Be Edited.  The original is offline." 

    What version of iPhoto?
    Are you running a Managed or a Referenced Library?
    A Managed Library, is the default setting, and iPhoto copies files into the iPhoto Library when Importing. The files are then stored in the Library package
    A Referenced Library is when iPhoto is NOT copying the files into the iPhoto Library when importing because you made a change at iPhoto -> Preferences -> Advanced. (You unchecked the option to copy files into the Library on import) The files are then stored where ever you put them and not in the Library package. In this scenario you are responsible for the File Management.

  • How can I get Captivate to revert to the top of the screen for each slide after published?

    I have a project captured in 1024x768.  If the user has many toolbars in browser, they have to scroll to see the whole screen.  If they use F11 in IE, this virtually eliminate the problem.  In MAC however, there is no F11 feature.  So, how can I get the published Captivate file to load each new screen at the top scroll position?  I have tried changing the html and tried adding Multiple Actions on success to click boxes with Go to Next slide and Execute JavaScript command: onload='window.scrollTo(0,1)'.  Neither are working.  Any idea how to get the screens to stop holding the previous screen position?
    Thanks!

    Hi GoldenCJ,
    Please remove "onload" from your javascript command. The "onload" event is fired when a html page(or any other page for that matter) is loaded. In your case the page is already loaded, that is, the page is loaded again when the user moves from one slide to another. Hence your javascript will not  be executed.
    So just have
    "window.scrollTo(0,0)" as your javascript.
    This should work fine.
    P.S. The execution of the javascript is browser dependent and browser settings dependent.I tried with chrome,IE 6 and FF 3.5, it is working. Please make sure that your target audience have javascript enabled in their browser.
    Thanks

  • I somehow managed to add lines on my master slide and can't get rid of them.  I now have a useless rectangle on the left half of many of my slides.  How do I remove this?

    I somehow managed to add lines on my master slide and can't get rid of them.  I now have a useless rectangle on the left half of many of my slides.  How do I remove this?

    Select the master slide,
    copy any objects you want to keep,
    Select all, (command A), and press delete key.
    Paste back the items to retain (Command V)

  • Facebook is not loading properly and all my text and images are lined up along the right side of the page. How can this get fixed to the way it use to be?

    Facebook is not loading properly and all my text and images are lined up along the right side of the page. How can this get fixed to the way it use to look?
    Everyone who logs into Facebook on my Firefox has this problem however if we use Internet Explorer - facebook looks normal.

    If you have increased the minimum font size then try the default setting "none" as a high value can cause issues like you described.
    * Tools > Options > Content : Fonts & Colors > Advanced > Minimum Font Size (none)
    *Tools > Options > Content : Fonts & Colors > Advanced > [X] "Allow pages to choose their own fonts, instead of my selections above"

  • My new iPhone 4 will not play on the iHome iP1 Speaker System. I have removed the case and seated it properly and it charges, but does not play music. How can I get it to work?

    My new iPhone 4 will not play on the iHome iP1 Speaker System. I have removed the case and seated it properly and it charges, but does not play music. How can I get it to work?

    Hi there Graham!
    I have a couple of articles that can help you troubleshoot this issue. First, if you are downloading HD content, you will need to know the system requirements for HD playback, which can be found here:
    iTunes: Purchasing and viewing HD videos
    http://support.apple.com/kb/ht3209
    Next, you will want to check your video playback settings on your Windows machine. The steps for that can be found right here:
    Troubleshooting iTunes for Windows Vista or Windows 7 video playback performance issues
    http://support.apple.com/kb/TS1718
    Hope that helps. Thanks for using the Apple Support Communities!
    Cheers,
    Braden

Maybe you are looking for