Execute Text Script bug report macOS Sierra 10.12.5 (16F73)

Dear Developer,

As per subject, the success rate of Execute Text Script is 50% due to my system updated to 'macOS Sierra 10.12.5 (I guess).

My AppleScript is quite simple:

open location "tel://+86xxxxxxxxxx?audio=yes"

Can you look into this?

Kind Regards,
Donnel

I’m sure others can attest that the success rate for the Execute AppleScript action in Sierra is a lot closer to 100% than 50%.

What errors are you getting? What does the script results show? How is this (or other scripts) failing?

Something else is going on on your Mac.

Hi Peter,

Before I am updated to macOS Sierra 10.12.5, all my script running very well. I mean at least Sierra 10.12.4 is fine.

that’s why I guess it’s might be reason of the updated macOS reason.

When I run it it’s just no result, and when I re run it, it’s run 100% succeed.

other Scripts are good, and my Mac have no other issues.

Kind Regards,
Donnel

This is due to a bug affecting ‘open location’ in 10.12.5, try this:

do shell script "open 'tel://1234567890'"

Hey Donnel,

Rudi is probably right. There have been reports of problems with open location on the Applescript Users List.

So far the workarounds are:

AppleScript:

tell application "FaceTime"
   open location "tel://1234567890"
end tell

Directly telling the app you want to open the URL seems to work.

Shell script:

open 'tel://1234567890'

Don't use a do shell script_ command in AppleScript when you can run it direct from an Execute a Shell Script action — unless of course it's part of a larger script.

-Chris

2 Likes

Great! Thank you All!

So my current updated AppleScript as follows works very well

set myNumber to textFilter(get the clipboard, "0123456789")

set userCanceled to false
tell application "System Events"
    try
	    set dialogResult to display dialog "Dail Phone Number" with title "Dail Phone Number via my iPhone " buttons {"Cancel", "Go"} default button "Go" cancel button "Cancel" giving up after 300 default answer myNumber
	    on error number -128
	    set userCanceled to true
    end try

    if userCanceled then
	    display dialog "User Canceled."
    else if gave up of dialogResult then
	    display dialog "User timed out."
    else if button returned of dialogResult is "Go" then
	    set text_returned to text returned of dialogResult
    end if
end tell

tell application "System Events"
    try
	    open location "tel://+86" & (text_returned) & "?audio=yes"
    end try

    repeat while not (button "Call" of window 1 of application process "FaceTime" exists)
	    delay 0.75
    end repeat
    click button "Call" of window 1 of application process "FaceTime"
end tell

on textFilter(thisText, allowedCharString)
    set {oldDelims, AppleScript's text item delimiters} to {AppleScript's text item delimiters, {""}}
    set the parsedList to every text item of thisText
    set newList to {}
    repeat with oneChar in parsedList
	    set oneChar to contents of oneChar
	    if oneChar is in allowedCharString then copy oneChar to end of newList
    end repeat
    set the newText to the newList as string
    set AppleScript's text item delimiters to oldDelims
    return newText
end textFilter

Hi, here is a auto-dial macro that does not require AppleScript, and runs fine on macOS 10.11.6. Would you mind testing it on your Sierra system?

##Macro Library   [FT] @Dial iPhone with Selected Number @FaceTime Sierra Test


####DOWNLOAD:
<a class="attachment" href="/uploads/default/original/2X/6/6d59b35accfe58c5ac364e082e333cb6e2c93cca.kmmacros">[FT] @Dial iPhone with Selected Number @FaceTime Sierra Test.kmmacros</a> (24 KB)
**Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.**

---

###ReleaseNotes

Author.@JMichaelTX

PURPOSE:  Dials Selected Phone Number using your iPhone

HOW TO USE:

1.  Select a phone number in any document of any app
2.  Press the Hot Key
3.  To Dial:  Press RETURN when Dialer Window appears
4.  To Hang Up:  Press ESC if Dialer has focus, or click on "End Call"
    * (Requires Macro "[FT] Decline or Hang-up Phone Call")
5.  I have tested this ONLY with US numbers, but it should work with any phone number that your iPhone can use.

WHAT IT DOES:

1.  Uses the FaceTime app to place audio call.
2.  All non-digits are removed, and only numbers are passed to the iPhone to dial.

REQUIRES:  

1.  Yosemite or later
2.  iPhone with iOS 8+
3. Macro:  [FT] Decline or Hang-up Phone Call