AppleScript talk events

I'm still prey to Messages does not not with AppleScripts "speak events." I was sorry when I upgraded to Yosemite. This is where the problem started. Now I'm same example I upgraded (with the promise of a fix) to El Capitan.  Is there someone who has found a workaround for this? Thank you...

This is one of the several messages that I got

Tags: Mac OS & System Software

Similar Questions

  • Meet an applescript event in LabView 2009 (Mac OSX) VI

    I have a LabView VI that works constantly, acquisition of data at a remote location.  I recently bought a UPS for power cuts, and I would like to be notified by LabView by e-mail that an event has occurred.  Can I have the UPS software run an executable when there is a power failure, so my question is this:

    How to run an executable file (preferably AppleScript) and have it trigger an event in LabView 2009?

    The main VI is still running, and I would like to respond to an event and send a mail/text to the appropriate personnel, so that they can respond accordingly to the power failure.  In addition, if power failure, I can then stop the experience "smoothly."

    It seems that all the pieces have to exist to do this, but I can't find a way to get there.  Thank you in advance, this will make many people happy!

    News: Mac OS X 10.5.8, LabView 2009

    Hi jumpman Jr,.

    When you say that the UPS software may run an executable file, which means that it can run an executable of LabVIEW? If so, you can write a small executable of LabVIEW to send an email to a specified address. In the measurement of the notifying the main VI that is running, you can try to communicate between the executable and the VI using the methods of normal communication of VI at VI, i.e. global variables, functional global variables, shared variable network published, or even tax filers or queues. Then you can safely leave your main VI.

    Aaron P

    National Instruments

    Technical sales engineer

    http://www.NI.com/support

  • AppleScript: How can I attach a script to an event?

    I have an applescript script that create a PDF and upload to a specific destination. (see below)

    I want to call this script whenever the user "saves" the doc.

    I am a novice when it comes to applescripting InDesign... I don't know if its possible to attach a script to the function "Save"?

    I guess I need to incorporate an event listener? Yet once, I guess. Perhaps there is a better way? attach the script to the command-s key combination?

    the goal is to give the user the ability to send a PDF file, whenever they record a document.

    Here's the script to this day:

    ......................

    the _ExportPDF value (display dialog "sending proof?") with the icon warning buttons {'Cancel', 'PDF'} ( default 2)

    Tell application "Adobe InDesign CS6"

    If the back button _ExportPDF is 'PDF' then

    Set myFolder ' PDFProofs:

    the dest myFolder as text Unicode value

    the value screenSettings PDF export preset "[high quality Print]."

    Set page range of PDF export preferences to all pages

    the docName document name value 1

    If docName ends with ".indd" then

    the docName text 1 thru-6 of docName value

    end if

    Tell application "Adobe InDesign CS6"

    Export 1 document format type PDF to (dest & docName ".pdf") using the screenSettings without options

    adapted from the document If active is true then

    say active document for Save

    close document 1

    end if

    (*

    According to the PDF export preferences

    See the PDF set to true

    tell the end

    *)

    tell the end

    end if

    tell the end

    ......................

    I thought about it.

    an event listener must be placed in the folder of InDesign startup scripts

    This script listening to Save events... more precisely: afterSave, afterSaveAs, afterSaveACopy

    (he could listen for other events as well, but I'm only interested in recording after functions)

    I wanted to start my upload PDF script after all these events... so the script was very simple

    Tell application "Adobe InDesign CS6"

    Set myEventNames to {"afterSave", 'afterSaveAs', 'afterSaveACopy'}

    Repeat with myEventName in myEventNames

    make the listener event with properties {event type: myEventName, handler: ' Macintosh HD:Applications:Adobe InDesign CS6:Scripts:Scripts Panel: Samples:AppleScript:PDFUpload.scpt '}

    end repeat

    tell the end

    the path to my applescript PDFUpload = Manager

    one and done

    Thanks for all your help! R

  • Calendar of future events is not displayed

    Calendar does not show future events in the search & spotlight search also

    Welcome Kevin_lpc,

    Thanks for posting on Apple Support communities. I see that the calendar does not show upcoming events in your Spotlight search. I know how it is to have. I'll be more than happy to help.

    Take a look at this article:

    Use the search on your iPhone, iPad or iPod touch - Apple Support

    In particular, take a look at the end that talks on the parameters. You want to make sure that the calendar is enabled in Spotlight search.

    Change search settings

    Go to settings > general > Spotlight search.

    From there, you can enable or disable the Suggestions of Siri and choose which applications to include in your search. For example, if you don't want to see the results of the research in your Messages app, you can deselect Messages.

    If you don't want Siri or Spotlight to suggest close places, go to settings > privacy > location Services and press Siri and dictation. Under allow access to location, tap never. Find out where you can use the Spotlight Suggestions.

    Take care!

  • AppleScript for the development of Documents of numbers

    Hello!

    I just finished my first 'Real' Applescript to do something that I thought was pretty simple.

    It took me 5 days to figure it out!

    In any case, I regularly create new documents of numbers whenever I make a deposit in cash for the accountant of campus

    (I am a teacher/middle school band Director and am constantly receive payments from children for t-shirts, uniform band, travel expenses, etc.)

    I tried for years to find a way to compile all deposit slips in a single document to keep track of who paid for what during the school year and I always ended up having to manually copy and paste the data of each doc in the main list (last year I had more than one hundred different deposits slip files in a folder on my desktop).

    Long story short, I discovered Automator and Applescript a couple weeks ago and have been playing with them. Who would have thought that these tools had been all the time on my mac!

    If someone (much more qualified than me) could take a look at the code, I am come with below to see if she is healthy, of if there is a more effective way to achieve this, I very much appreciate it!

    The code works for now, but if there is something or any weakness that could break it in a future update, I would like to know about it.

    CODE BELOW:

    -------------------------------------------------

    -It is my attempt to create an AppleScript to copy data from several numbers documents and compiling a database for use in a single master Document numbers.

    -The way it's Setup now, whenever a new document data is added to the source folder, I double click on an icon on the desktop that runs this script.

    game of sourceFolder to (POSIX file ' / users/my_name/library/2016-2017 Financial Documents TO BE ADDED / " as alias)

    -source folder for documents to add to the main list


    game of to targetFolder (POSIX file ' / users/my_name/library/2016-2017 Documents financial/DONE / " as alias)

    -Place for documents to go after they are added to the main list.


    game dittos to (Choose file with prompt "choose a numbers Document to copy in the type list." as text by default location sourceFolder)

    -The script will ask me to select a file out of the source folder to copy


    say application "Numbers".

    activate

    the value doc to Open dittos

    say table 1 of the sheet active of the doc

    the value thisRangeName to '03:37.

    -the range I want to copy

    the value the range selection for range thisRangeName

    -selects the range I want to copy

    end say

    end say

    say application 'System events' to hit 'c' with the command down

    -copy the selected to the Clipboard.

    property docTarget: "/ users/my_name/library/2016-2017 band Documents/2016-2017 student List.numbers.

    -The location of the master file

    property today: current date

    -variable to use when entering information in the master file. This helps to sort the objects added to the master file.


    say application "Numbers".

    Open docTarget

    say 1 of table sheet "Sums of MONEY RECOVERABLE" of front document

    Add the line below last line

    -creates a new line to receive new information.

    the value the value of the last first cell at (today's date) string a line

    -between the current date in the first column of the table

    set the selection go in last second cell line

    -moves the selected cell to the one who will receive the data from the Clipboard.

    say application 'System events' to hit 'v' with the command down

    -Paste the Clipboard data

    say application "System events" of typing "ESC".

    -Deletes the currently selected cells

    end say

    -We will now check for empty lines that have been pasted from the source document to clean our Master Document.

    say 1 of table sheet "Sums of MONEY RECOVERABLE" of front document

    Set rowCount to (each line of the selection between)

    -the number of rows to check? Number of rows is determined by the amount of the previous selection range.

    Repeat with I of 3 for the count of number of lines

    -ignore the first 2 rows, which are header lines, the County

    the value may be to (value of fifth cell in last line)

    -checks the value of the fifth column (reason for the activity) to see if it is empty.

    If perhaps missing value then set went to last row

    -from the last line of the document, if the fifth column is blank, it is marked for deletion.

    Remove gone

    -remove the empty line

    end Repeat

    the value is in (value of fifth cell in last line)

    -When the repeated destruction are complete, if there is an extra empty line remains, it will get.

    If done then delete last rank missing value

    -the if statement that will remove the last extra line

    end say

    end say

    quit smoking application "Numbers".

    -close all documents of numbers and quit the application

    say application 'Finder '.

    move File to the folder targetFolder Dittos

    -move the Source file out of the folder "TO BE ADDED" and in the "DONE" folder.

    end say


    --------------------------------------------------


    Thanks for the help and advice of an Applescript Newbie!

    -Jimforxst

    First of all, if the script works for you, then it's good enough

    Even experienced/veteran AppleScripters can spend a lot of time to 'perfect' scripts, so it is important to balance the how long it will take to arrive at a solution that is "perfect".

    If you're looking for pointers that might work "better", here are a few thoughts.

    First of all, your script depends on literally copy and paste the data from the source file for the master file. I'm never a fan of this approach. All works (clearly), it is prone to error and changes the State of the system - not sure if what was in the Clipboard the script at startup has been sought, and the operator (if it wasn't you) do not doubt that the execution of the script would change the contents of the Clipboard. In general, I think it's better to reference the data directly ("set data2Copy to (get the ranks 1 to 37 of table 1...)"), although it works for now.

    In addition, your script is depends somewhat on the specifics of the source and master files. There is no error checking that the source data is valid before you copy it.

    On the same topic, you have a significant amount of code to check if the column 5 is empty. I would consider doing this check at the front - in other words only copies the data you need, rather than copy more and must clean up afterwards. Once again, the details of this function a bit on the data.

    Finally, for the moment, the script runs on a single file at a time - opens the source file, opens the master file, copies the data, close the files and closes way unexpected numbers.

    What happens if there are multiple source files to process? You can consider a loop through the files, the copied data and closing/smoke right at the end. That would save some time.

  • AppleScript to automatically copy a video in one of the two folders

    Hi, on my drive hard, I have 2 partitions, one for my 10.10.2 OS and the other for my files. On my player I have 2 folders which I want to copy the video on: 'Movies' and 'Kids Movies. I put a "folder Action" on mounting my USB key to run this applescript I below. It automatically copies the video in my "Movies" folder, then after completing the copy, ask if I want to "Eject" usb drive via a dialog Yes or no.

    My question is, what is the script to add an another dialog box before the copy request is a film 'children '. A "Yes" response, the film would copy into folder 'Film Kids', if you press 'No' it might copy the video in the folder 'movies '. Help with this script would be greatly appreciated.

    My applescript so far:

    property ignoredVolumes: {'10,10 30 1. 5 't', '1. Add 5 t files"} - if necessary

    property videoExtensions: {"avi", "mov", "mpg", "wmv", "mp4" and "mkv"}

    the value moviemacVolume to the alias (POSIX file "files/Volumes/1. ("5T / movies")

                               tell application "System events".

    the value rootVolumes to disk (POSIX file ' / Volumes ' in the text)

    the value allVolumes to name of every element of disc of rootVolumes

    the value numofallVolumes to the County of allVolumes

    Repeat with the present book in allVolumes

    say application 'Finder '.

    if (the present book is not in ignoredVolumes and (this book as text) is not '. ') DS_Store') then

    Try

    if there are alias (POSIX (' / Volumes / "& the present book) as text file ) then game trk to 1

    on error

    game trk to 0

    end try

    If trk = 1 then

    duplicate (elements whose name is in the videoExtensions extension) in alias (POSIX file (' / Volumes / "and the present book) as text) to moviemacVolume

    say application 'Finder '.

    display the dialog box "Would you like to eject the USB drive?" button by default buttons {"Yes", "no"} 1 with the title "Eject?" give up after 60

    If the button returned of the result is 'yes' then ejection of the this book

    end say

    end if

    end if

    end say

    end Repeat

                   end say


    Replace the current command in double with:

    display the dialog box "is a child movie?" buttons default button {'Yes', ' no'} 1

    If the back button on the result is 'Yes' then

    Duplicate (items which extension is in the videoExtensions) in alias (POSIX file (' / Volumes / "& the present book) as text) to alias (POSIX file" / Volumes/files 1.5T/movies/kid's movies / ')

    on the other

    Duplicate (items which extension is in the videoExtensions) in alias (POSIX file (' / Volumes / "& the present book) as text) to moviemacVolume

    end if

    (143506)

  • Lightning don't talk to Google Calendar - problem with cookies?

    Execution of Thunderbird 31.1.0 with Lightning 1.0 and the module supplier of Google. I maintain four different calendars with google (work room, home, other, conf) account. When I woke up today all my calendars worked. They have been set up in lightning as calendars google network, which stressed their respective links to XML.

    All of a sudden this afternoon, without me antics with any of the parameters GCal or lightning, calendars in the sidebar of the lightning stopped to talk with the platform of google calendar. All events always appear in google calendar thin and fine always sync up to my mobile device.

    The problem is: the calendars are just sitting and showing the color of the light "synchronized." When I right click on one and try to activate it manually in lightning, it displays a prompt of password for google account. After entering my google login information, returns the window of dialogue: "Oops!" Your browser appears to have cookies disabled. Make sure that cookies are enabled, or try to open a new browser window. "

    I can assure you that cookies have been enabled in my Chrome browser settings. Double even checked in Firefox, even though it isn't my default browser, they are activated too. There is no need to change the message "cookies disabled". I went up to erase all data of the chrome, by suggestion of the googles and no dice. Even uninstalled Chrome and re-installed and no luck.

    I must be missing something. It shouldn't be so hard to make the switch from cookies and get these programs talk to once again...

    Will be

    You must allow cookies for google.com in Thunderbird.

  • How to end a loop using hits/keypress in applescript?

    the value dFolder to '~/Desktop/screencapture/ '.

    the shell script ("mkdir - p" & dFolder)

    the value I 0

    the value x for the shell script 'date + %m %d - hour %M %S %Y' as string

    repeat 10 times

    define a shell script ("screencapture gif t - x" & dFolder & i & x & ".gif") as string

    Try

    say application "Image events".

    the value this_image to Open one

    this_image scale size 10

    Save this_image

    end say

    end try

    delay 3

    the value i to i + 1

    end Repeat


    Sample applescript with a screencapturing loop.

    Problem: How to end the loop using the key combination or keycode?

    Problem: How to end the loop using the key combination or keycode?

  • Syntax error in AppleScript, written at Automotive Search + 4 zip code

    I am very interested to find and install a script or a 'code' any that would allow me to enter an address and when I go to insert the zip code, it was automatically filled in with + 4 part of the postcode.  It's a generally available information to this web page: https://tools.usps.com/go/ZipLookupAction! input.action

    The problem is looking for every contact I have add and there are several, is just a tedious task of many steps which should be a pretty easy solution for the 'writing' "applescript" to understand.  I'm not a programmer and basically just need someone to take a look at this code and see where I might have a problem.  This code is provided by a person for me and unfortunately, they assured me that it worked with previous versions of the application contact for the previous operating system - it seems not however, with the new application 'Contacts' work.

    After talking with a few different apple consultants who are not able to help or simply not have the time, I thought that I could join the community and see if I could win any help or support.

    Please see the code below-

    I have it saved as a script from apple and am aware that this belongs to be saved in one of these two files, once it works correctly:

    / Library/Application Scripts/com.apple.AddressBook

    or

    / Library/Application Support/AddressBook /.

    Here's the Script:

    -code postal locator

    using terms from application "Contacts".

    on action property

    return "address"

    end action property

    on the action title of p with e

    If the zip of e contains "-" then

    return "This ZIP Code.

    on the other

    return 'ZIP + 4 Lookup'

    end if

    end action title

    We should allow action for p with e

    If e zip does not contain "-" then

    Returns true

    on the other

    return false

    end if

    end should allow an action

    perform in action for p with e

    the value LookupURL ¬

    "https://tools.usps.com/go/ZipLookupAction!" input.action"& Street e &"& address2 = & city ="& ¬"

    City of e & "& status =" & State e & "& & urbanCode = & postalCode = & zip = '

    Tell application "Safari" to open location LookupURL

    Returns true

    end to perform action

    Two things:

    (1) you have Contacts in 'Smart' quotes Remove them and replace them with normal double quotes.

    (2) you need, end up using phrases of the declaration at the end of the script.

    ---- zip code locator
    using terms from application "Contacts"
      on action property
      return "address"
      end action property
    
      on action title for p with e
      if zip of e contains "-" then
      return "Zip Code Present"
      else
      return "ZIP + 4 Lookup "
      end if
      end action title
    
      on should enable action for p with e
      if zip of e does not contain "-" then
      return true
      else
      return false
      end if
      end should enable action
    
      on perform action for p with e
      set LookupURL to ¬
      "https://tools.usps.com/go/ZipLookupAction!input.action" & street of e & "&address2=&city=" & ¬
      city of e & "&state=" & state of e & "&&urbanCode=&postalCode=&zip="
      tell application "Safari" to open location LookupURL
      return true
      end perform action
    end using terms from
    
  • Script using AppleScript GUI does not

    Before we go too complicated, I'm starting to get a basic copy/paste using keyboard shortcuts to work. In theory, if I can copy a value of cells in another cell using keyboard shortcuts, I can use keyboard shortcuts, I need more complex scripts.

    Can someone more well informed that I look over the below basic code and tell me what I'm doing wrong?

    (I added the script editor to the security settings for accessibility to allow him to control the computer.)

    My code for a simple copy/paste in figures (other programs also not to answer):

    on run

    say application "Numbers".

    activate

    if not (there are document 1) then error number 1000

    say document 1

    tell the worksheet active

    the value the selectedtable to (the first table whose class of selection range is range)

    the value myRows to count the lines in selectedtable

    say selectedtable

    the value the selection range of cell 2 of rank 3

    sendCopy

    the value the selection range of cell 4 of rank 3

    sendPaste

    end say

    end say

    end say

    end say

    end run


    on sendCopy()

    say application 'Numbers' to Activate

    say application "System events".

    say application process "Numbers".

    key sequence « C »

    end say

    e nd dire

    end sendCopy


    on sendPaste()

    say application 'Numbers' to Activate

    say application "System events".

    say application process "Numbers".

    key sequence « V »

    end say

    end say

    end sendPaste

    Thank you

    Jason

    You favorite the AppleScript Language Guideand then use the appropriate syntax:

    key sequence Using 'C' command down


    key sequence 'V' with the command down


    It may or may not be other contributory factors in your script as to why it does not work.

  • AppleScript, convert Word to PDF doc

    This applescript allowed the user to select a word, converted doc the doc to PDF, sent by mail and then the PDF file to the trash. It worked perfectly until today, after the most recent update of OS X.

    Any advice would be appreciated!

    --------------

    Tell application "Microsoft Word"

    activate

    Set target_file choose file

    Open target_file

    doc the name value in the window active

    tell the end

    Tell application "system events".

    delay 1

    the x value of the offset of the "." in the doc

    There the text 1 thru (x - 1) from the doc value

    tell the end

    Tell application "Microsoft Word"

    the theOutputPath value (' HD:Users:xxxx:Desktop Macintosh: "& y &".pdf")

    Save as format document file format file name theOutputPath PDF assets

    Close active registration No.

    tell the end

    Tell application "Mail".

    newMessage make new message coming out with properties the value {subject: y, content: "Attachment"}

    tell newMessage

    brand new beneficiary at the end to recipients with properties {name: 'xxxx', address: '[email protected]'}

    According to content

    making new hardware connection with properties {filename: theOutputPath as alias} to after the last paragraph

    delay 1

    tell the end

    tell the end

    Send newMessage

    tell the end

    Tell application "Finder" to move the theOutputPath file to the trash

    As an update has caused your problem - contact apple support.

  • Use AppleScript to open boxes smart mailboxes

    Is it possible to use AppleScript to open/view a specific smart mailbox in mail?

    I have a Microsoft Exchange e-mail account in Mail, with several boxes to letters and emails stored in each. The name of each mailbox corresponds to a name of a certain record/entry in a FileMaker Pro 13 database. I would like to have a button in every record/entry in the FileMaker database, once clicked to run an AppleScript script which will be open / view of the mailbox in mail for that particular record.

    For reference, I'm under FileMaker Pro 13, Mail (v9.3) on OS X El Capitan (v10.11.4).

    Is it possible to use AppleScript to open/view a specific smart mailbox in mail?

    I don't know anything about Microsoft Exchange or FileMaker Pro.

    However, the following GUI script may select a smart mailbox under OS X 10.11.3.

    the value theSmartMailboxName to 'TEST' - replace 'TEST' with any name of your choice

    say application "Mail".

    launch

    activate

    say application 'System events' to say process "Mail".

    key sequence '0' using {control down}

    If subrole of window 1 is "AXFloatingWindow" then click on the button 1 of window 1

    if not (are scrolling area 1 of the Group splitter 1 of window 1) then

    key sequence "m" using { control down,shift down}

    end if

    say 1 1 of the Group splitter 1 in structure window scrolling area 1

    Select (row 1 of which value of text field 1 of UI element 1 is theSmartMailboxName)

    end say

    end say

    end say


    Also take a look at this article.

  • Bluetooth file transfer applescript auto

    Hello. I met a problem when I try to run this applescript.

    The purpose of this applescript is when you single click on any file and run this script, it will be automatically transferred this file to a device on the bluetooth named 'david '. But I have encourtered a problem in the underdashed line. The output shows:

    "error " events system has had an error: can not get scroll area "of the window process \"Bluetooth File Exchange\ 1' \"Bluetooth Devices\. ' number-1728 box scroll "Bluetooth devices" of window 1 of process "Bluetooth File Exchange"" "

    and I don't know why. I'm totally a noob to applescript, it is a part of the script written by someone else, and I just changed and add a little bit.

    Can anyone help please?

    device property : 'david '.

    say application "Finder" to the value of selection as alias fileAlias

    the value fileToSend to the fileAlias

    say application "Finder" Open fileToSend using the application file id "com.apple.BluetoothFileExchange".

    Activate application "Bluetooth File Exchange.

    say application "System events".

    say process of "Bluetooth File Exchange.

    Repeat until there are 1 window

    end Repeat

    Select (1st row from the table of area scroll "Bluetooth devices" of window 1 whose value of the text field 1 is peripheral)

    click on button 'Send' of the window 1

    end say

    end say

    Try this instead:

    Select ((line 1 of table 1 1 for window scrolling area 1) whose value of UI element 2 to 1 is the device UI element )

    or:

    Select ((line 1 of table 1 1 for window scrolling area 1) whose value of static text 1 of UI element 1 is the device)

  • I need help to create an AppleScript to autoclicking.

    I just started using AppleScript, so there is still a lot of things I don't know. Currently, I'm doing a script where I can click in an infinite loop / repeat. I received this understood part and now I want to step up a notch by making a condition where in when I right click with my mouse, I'll be able to enable / disable this script. Or even shut down the loop with a right click. In addition, I would also add a bonus dialog box once I finished the script by right-clicking.

    Here's my working process.

    say application "System events".

    -a loop (# repeat, repeat times)

    repeat 10 times

    -trigger system event are asked to use the button code 87 (left click on the mouse)

    say application 'System events' in the key code 87

    delay 1

    end Repeat

    end say



    -Right click

    say application 'System events' to code key of {command down} 87

    -closing of the script

    display the dialog box "Do you want to exit this script?" buttons {"Exit", "Continue"} default button 1

    If result = {return button: "Exit"} then

    return

    end if


    The upper part of the script, this is what I mentioned the first where I get an infinite loop to the left, click the mouse button. The two scripts from the bottom is what I would like to integrate the above script to get the result I want. An infinite loop with condition (right click) to disable the script and a message if poster after the script has stopped.

    Hi Cloud4846. One option is to create a small utility to detect a mouse button for use in an AppleScript script. Copy and paste the following in a text editor Swift code as text Sublime and record your desktop with a file extension .swift using a name such as mouse.swift:

    import of Foundation

    import AppKit

    TranslateButtonState(buttonState: Int)-> {String Func

    If (buttonState == 1 < < 0) {return "left" ;}

    If (buttonState == 1 < < 1) {return 'right' ;}

    go back to 'none '.

    }

    buttonState var = NSEvent.pressedMouseButtons)

    Print (TranslateButtonState (ButtonState))

    With Xcode installed, compile the code above with the Swift compiler in Terminal using the following command, which places the binary file in usr:

    xcrun - sdk macosx swiftc ~/Desktop/mouse.swift o/usr/local/bin/mouse

    You can test the utility in a Terminal before control of the mouse with a delay and press left mouse button to the right:

    sleep 1; mouse

    Output returned is one of the 'left', 'right' or 'none '. The utility also works with a finger or two mechanical depression of a trackpad for the primary and the secondary finger click respectively.

    You can use the utility in an AppleScript script to display a dialog box message when a mouse button is released, in this example the right button of the mouse. Keep in mind it's because of the single-threaded nature AppleScript and that the 'do shell script' in the loop with delay, is really only practical with time short longer times require holding down the mouse button longer:

    Tell application "system events".

    Repeat 10 times

    the mouseDown value (the shell script ' / usr/local/bin/mouse ")

    If mouseDown = "right" then

    button code 87

    dialogue box "Do you want to exit this script?" the default button buttons {'Exit', 'Continue'} 1

    If result = {return button: "Exit"} then

    return

    end if

    on the other

    delay 0.5

    button code 87

    delay 0.5

    end if

    end repeat

    tell the end

    Instead of using a mouse button down event to trigger a dialog box, you can use a key as a modifier key. Copy and paste the code Swift following in a text editor and save it to your desktop with a file extension .swift using a name such as modKeys.swift:

    import of Foundation

    import AppKit

    TranslateModifierFlags(modifierFlags: NSEventModifierFlags)-> {String Func

    Let rawModifierFlags = modifierFlags.rawValue

    var pressedButtons = [System.Security.Permissions.SecurityPermission

    If ((rawModifierFlags & NSEventModifierFlags.ControlKeyMask.rawValue)! = 0) {pressedButtons.append ("Control")}

    If ((rawModifierFlags & NSEventModifierFlags.AlternateKeyMask.rawValue)! = 0) {pressedButtons.append ("Option")}

    If ((rawModifierFlags & NSEventModifierFlags.ShiftKeyMask.rawValue)! = 0) {pressedButtons.append ("Shift")}

    If ((rawModifierFlags & NSEventModifierFlags.CommandKeyMask.rawValue)! = 0) {pressedButtons.append ("Command")}

    If (pressedButtons.count > 0) {}

    return pressedButtons.joinWithSeparator("")

    }

    go back to 'none '.

    }

    var modifierFlags = NSEvent.modifierFlags)

    Print ((modifierFlags) TranslateModifierFlags)

    With Xcode installed, compile the code above with the Swift compiler in Terminal using the following command, which places the binary file in usr:

    xcrun - sdk macosx swiftc ~/Desktop/modKeys.swift o/usr/local/bin/modKeys

    You can test the utility in a Terminal before control of the mouse with a delay and pressing one of the four control, Option, shift, and control modifier keys individually or in combination:

    sleep 1; modKeys

    Output returned is one or more of 'Control', 'Option', 'Shift' and 'order '. An example of the usefulness and the SHIFT key, used in an Applescript script:

    Tell application "system events".

    Repeat 10 times

    the keyDown value (the shell script ' / usr/local/bin/modKeys ")

    If keyDown = 'Shift' then

    button code 87

    dialogue box "Do you want to exit this script?" the default button buttons {'Exit', 'Continue'} 1

    If result = {return button: "Exit"} then

    return

    end if

    on the other

    delay 0.5

    button code 87

    delay 0.5

    end if

    end repeat

    tell the end

    More appropriate to use modifier keys are shift and Option.

    Tested with OS X Yosemite 10.10.5, editor Script 2.7, 2.4, Xcode 7.2.1 AppleScript

    AppKit framework reference > NSEvent Class Reference

    The fast programming language

    Introduction to AppleScript Language Guide

  • Need to talk to the German customer

    I recently got a Toshiba Satellite U920T-101 by a colleague who was leaving my company.

    He had an intermittent problem with the screen, which has now become a permanent error. I received the laptop with what I think is the serial number. There is no label on the laptop with the serial number.

    The screen is not working so I can't read the serial number of the bios.
    Also the HDMI output not working so I can't use an external monitor.

    I was hoping that I could send a Toshiba with what I thought, it was good serial number and ask some advice, but this is proving to be quite difficult. There is even a wizard to send an e-mail, which rejects the serial number I have.

    I want to send because I live in Germany and need to talk to German customers and my German is not good enough to talk to people on the phone.

    Hello

    In the event of hardware problems, your first point of contact should be the Toshiba authorized service provider which is available (in your case) in Germany

    Here you will find a database with all FSA available worldwide:
    http://www.Toshiba.EU/innovation/generic/ASP_SUPPORT/

    See also the toshiba.de page... you can find the contact form request technical (for laptops, tablets und CAMILEO cameras)
    http://www.Toshiba.de/innovation/generic/contact_page/

    I hope this helps.

Maybe you are looking for