AppleScriptObjC and setStyleMask

I want to programmatically set the mask of a window style according to the preferences of the user.

I see documentation that you can combine the style options using the C at the level of the ILO OR operator, so I thought it would be something like:

setStyleMask_(NSTexturedBackgroundWindowMask | de mainWindow NSClosableWindowMask |) NSMiniaturizableWindowMask | NSTitledWindowMask)

(I know that I need "from the current application" in front of each of them but didn't write)

.. .but the code produces an error. What is the correct way to do it?

AppleScript does not all operations at the level of the ILO, but behind the scenes, what are some numbers in order to force them to integers and add them together.

Tags: iOS Developer

Similar Questions

  • AppleScriptObjC and multiple threads

    Hello again people.

    I read some old threads here to have multiple threads in a Cocoa-AppleScript application, but I have not found any that I think that would work for my particular use case.

    Here's my situation: I have a method that expects that the user say a phrase and then runs another method when he hears the phrase. Here is the code that I currently use:

    on listenForQuery()
    set query to ""
            try
                tell application "/System/Library/PrivateFrameworks/SpeechObjects.framework/Versions/A/SpeechRecognitionServer.app"
                    set query to listen for {"Hello"} giving up after 5
                end tell
            end try
            if query as text is equal to "Hello" then my newQuery_(null)
            performSelector_withObject_afterDelay_("listenForQuery", missing value, 2.0) -- do it again every two seconds
        end listenForQuery
    

    AppleScriptObjC is not multi-threaded, but it seems that you forgot that it can use many of the classes and methods of cocoa.  Instead to use AppleScript to control another application, take a look at aid NSSpeechRecognizer in yours - you can give it a list of commands to listen and to define a delegate method that is called when something is recognized.

  • AppleScriptObjC get a foreground app icon

    All my scripts are launched from FastScripts.

    When you use the basic command to display alert since the additions dosed, the alert is delivered with the application icon of foreground (as expected).

    But when you use the AppleScriptObjC method to create an alert, the icon displayed is the FastScripts one.

    Is there a way to get the icon of a foreground application and forward it to the alert?

    I saw there is an applicationIconImage method but don't know how to use it.

    Any clue?

    I don't know what you (or FastScripts) are made for the foreground application, but you can use NSWorkspace to get the application for any file, for example:

    set sharedWorkspace to current application's NSWorkspace's sharedWorkspace
    set theIcon to sharedWorkspace's iconForFile:(POSIX path of (choose file))
    
  • AppleScriptObjC help button

    Hi all

    I found how to display a Help (help) in alerts using the setShowsHelp command.

    I want to display a short text in one simple window (another alert?) when this button is clicked.

    I'm good at Applescript but totally new to AppleScriptObjC.

    All the setShowsHelp: method is to put a button in the alert - is your responsibility to implement.  The first step is to define the delegate of the alert (your AppDelegate, for example) and add a alertShowHelp: Manager to it.  When this is done the handler is called when the user clicks the help button.  To set up your own alert, take a look at other methods of the class NSAlert:

    set alert to current application's NSAlert's alloc's init()
    alert's setMessageText:"Alert"
    alert's setInformativeText:"Information"
    alert's runModal()
    
  • How can I convert cela AppleScriptObjC?

    I need simulate the touch of a button, but cannot be used for events of the sandboxing system.

    I found this, but it is written in pure Objective C and I don't know how to convert:

    CGEventRef e = CGEventCreateKeyboardEvent (NULL, (CGKeyCode) 31, true);

    CGEventPost (kCGSessionEventTap, e);

    CFRelease (e);

    AppleScriptObjC is supposed to be able to call C functions, but the reality is that not all of them are available.  Your should be able to tell the current application to run the function - something like:

            set e to current application's CGEventCreateKeyboardEvent(missing value, 31, true)
            tell current application to CGEventPost(current application's kCGSessionEventTap, e)
            current application's CFRelease(e) -- shouldn't need this, since ASOC does its own releasing
    
  • The Document-based application full ApplescriptObjc

    I'm working on a document in Xcode using ApplescriptObjc, Editor, but I'm having a problem. I can't understand how to create an integrated NSDocument application which can work to the level of something like TextEdit.  I would really appreciate if someone could point me to a good tutorial or documentation, ApplescriptObjc, or an example of code for me to go off of. Thank you!

    I doubt that you will find a lot of specific information AppleScriptObjC, because most of the tutorials and documents are in Objective-C (or Swift) and AppleScript isn't just popular for more serious application development.  Your best bet would be to download the TextEdit example code and convert the parts you need.

  • How to create a progress ApplescriptObjc Webkit bar

    I'm working on a based ApplescriptObjc web browser for OS X, and I'm stuck on getting a progress bar determined to view the progress of the loading of webkit view.  Does anyone have any ideas on how to do that? I would like to do so without a loop of constant repetition also. The perfect end goal would be to have a progress bar that reflects the progress of the loading of a web view and allow the user interface to remain responsive while it is running. Thank you!

    The WebResourceLoadDelegate methods are now obsolete since recently, but in fact they have changed just in a formal Protocol and the documentation has not yet caught up.  I don't know if something has changed in the way that ASObjC can access the delegate methods, but take a look at the WebKit Programming Guide.

  • I have an ipod touch 128 GB... but I'm almost to reach its maximum.  I want to do is buy a new ipod touch 128 GB and add new music without synchronizing the entire library to it... I have 2 ipods in conjunction with other copies

    I have an ipod touch 128 GB... but I'm almost to reach its maximum.

    I want to do is buy a new ipod touch 128 GB and add new music without synchronizing the entire library to it... I have 2 ipods in conjunction with the other copies of the other.

    is this possible?

    What should I do?

    Matt

    When you get the new iPod, you can use iTunes on your computer to select and synchronize the music you want on it, in the same way that you synchronize your current iPod - your iTunes will recognize them as different devices and will remember your choice of synchronization for each, it will not (unless, for example, you restore the backup of your current on her iPod) put the same content on both.

    (I asked for your post be moved to the iPod Touch forum, where you have posted is the iPad forum use.)

  • Why my notes sync between my Mac and iPhone?

    I have my MacBook Pro with Mac OS X 10.9.5 Mavericks and my iPhone is running iOS 10.0.1 and used to synchronize my notes! Is it because of the huge gap in operating systems? I SHOULD update my Mac to Mac OS 10.10 + for this problem? Thank you!

    In order to synchronize Notes between your Mac and iPhone, you must configure iCloud > http://www.apple.com/icloud/setup/

    But this requires macOS Sierra 10.12, the latest available version and the last iOS available for your iPhone.

  • Photos, iCloud and OneDrive sync

    Hi all

    I have a question on how to better organize my photo library.

    For the moment, on my space OneDrive (mapped to a partition on my MacBook SSD), I have a folder called 'Images' containing just about all of my photos and organized by folders.

    Since my tech ecosystem is roughly marked Apple (iPhone, iPad and MacBook), I would use the power and versatility of the Photos and iCloud, so that everything remains in all of my devices and free space memory iPhone sync.

    Here's the question: I want to keep my pictures saved on OneDrive, then put the Photos on my Mac to view photos from this folder and use iCloud to share through my devices.

    -I see the same folder structure on iPhone and iPad a synchronization is complete?

    -More important, if I take a picture with my iPad, it will be placed not only on iCloud but also automatically added pictures on Mac which, in turn, puts it in the folder of photos on my OneDrive?

    -Finally, take pictures of my iDevices will store them in the film. If I move them into folders, photos will be mapped (copied to iCloud) on my other devices constantly (in the folder)?

    I would like to notice I'm not trying to avoid using iCloud premium space - I already have a subscription plan of 50 GB that I don't mind mounted. I just keep having just all my photos on OneDrive.

    Thank you in advance for any comments you may have!

    Paul

    The answer is simply not

    The photo library can not be stored on a basic system to pictures not work will have a referenced library, so you may not have a local library references photos on a disc - the photo library can be on a local drive connected directly to the Mac OS Extended format

    You can synchronize between the Mac and IOS devices using iCloud library that synchronizes the photos and the structure of the album/folder between devices

    When you import pictures you can export them to your OneDrive record and have a copy (not associate Photos somehow) on a disk

    You can not have the same physical pictures in Photos and on one disc - each must have its own copy of the Photo

    http://www.Apple.com/icloud/photos/

    LN

  • Video and photos of backup

    Hello

    Anyone know the best way to back up photos and videos I took Iphone 6 my mom.

    I just got a new Iphone 6 more and have an icloud account, she has one more.  I don't know how to proceed.

    Thank you

    This article can help you:

    The backup of your iPhone, iPad and iPod touch - Apple Support

    You get free 5 GB of storage iCloud. If you want to save more than 5 GB, you buy more storage iCloud.

  • I have a lg 4 k tv (40 "40UH630V TV LG ULTRA HD 4 K) with HDMI 2. 0 and if I buy apple tv 4 can be used with HDMI 2. 0 port or do I HDMI 3 port to use this? Please help me

    I have a lg 4 k tv (40 "40UH630V TV LG ULTRA HD 4 K) with HDMI 2. 0 and if I buy apple tv 4 can be used with HDMI 2. 0 port or do I HDMI 3 port to use this? Please help me

    You can use it with your TV.

  • I need to change my security issues and said we do not have enough information to reset your

    I need to change my security but said Questions we have insufficient information to reset security of your apple ID questions.my is [email protected] I want to slove this problem please help me

    You should contact the account of Apple security team. To join, click here and choose a method; If this page does not list one for your country or if you are unable to call, complete and submit this form.

    (145174)

  • Updated for Sierra and cannot import images

    I upgraded to Sierra and my camera, a Canon EOS 20 d is is properly recognized.

    Prior to the upgrade:

    When I plugged the camera would open automatically. I close and open Photoshop. PS I would like to select Import-> device and my camera would be identified. When I select the camer displayed thumbnails of photo.

    After the upgrade:

    When I connect the camera pictures only opens automaticall. If I open the pictures is not a camera attached.

    PS when I select Import-> my camera device is represented, but the icon is an external drive. When I select the icon nothing is displayed.

    Hello ChuckSto,

    Thank you for using communities Support from Apple. I know have a problem with your Mac and your camera is not what you expect. The good news is that the next steps will be useful for your problem of your camera is not recognized:

    If nothing happens when you connect your digital camera

    Try the following:

    • Make sure that the USB cable is properly connected to your camera and computer. If your computer has a USB port, try connecting the cable inside.

    • Check your camera to make sure he turned on and set to mode suitable for importing the photos. See the instructions that came with your camera.

    • Check the memory card of your camera for damage. See the documentation that came with your camera for more information on this page or other potential problems.

    Photos for Mac: import pictures from a camera or a mobile device

    See you soon!

  • Speeches and a .key file cannot be opened

    I'm unable to open or work on Keynote documents. I get an error popup image that says: cannot open 'FILE.key' because it is not a valid document to Keynote. I'm assuming that the same problem will occur in numbers and pages so I have not used either of these programs in a very long time so I do not have a file to test on.

    I know that the file is indeed a valid Keynote document. I recently had to reinstall my package iWork 09 since the original software discs - I have them have not purchased through the App store or my iCloud account. I have a software key. I can't move my OS to Sierra right now because I have other software that I use for work and tech support as we said we cannot go immediately. My current OS is El Capitan 10.11.6, and I have a MacBook Pro 15 "retina.

    Any advice on obtaining Keynote works again until I can make the upgrade to Sierra?

    Thanks in advance.

    Sounds like you are trying use Keynote 09 to open a file created by Keynote 6.

    Keynote 09 cannot open files of version 6 because they are a different file format.

    If this is the case, buy and install Keynote 6 from the Mac App Store.

Maybe you are looking for