AppleScript support is broken

Issue #506 resolved
Jon Stovell created an issue

Almost all attempts to interact with Subler via AppleScript fail. Some scripts won't even compile, and others fail with errors when executed.

Steps to reproduce the problem: See below.

Subler version: 1.5.9

OS version: macOS 10.14.3

Details: Below are a series of tests I ran in Script Editor and their results.


Script:

tell application "Subler"
    get saveable file format
end tell

Result: compilation fails with syntax error "Expected end of line but found class name"


Script:

tell application "Subler"
    get every document
end tell

Result: execution fails with error "Subler got an error: Can’t get every document." number -1728 from every document

Notes: A document was in fact open.


Script:

tell application "Subler"
    get application
end tell

Result:

application

Notes: no errors reported, but attempts to get any of the standard properties of an application object fail. Apple generally advises developers not to redefine standard classes and keywords.


Script:

tell application "Subler"
    add to queue
end tell

Result: no errors reported, but nothing happens.


Script:

tell application "Subler"
    start queue
end tell

Result: the queue did start, but when the queue completed the script was not aware and so it never completed the step.

Notes: I manually added an item to the queue before running this script.


Script:

tell application "Subler"
    stop queue
end tell

Result: no errors reported, but nothing happens.

Notes: I manually added an item to the queue and started it before running this script.


Script:

tell application "Subler"
    get queue status
end tell

Result: compilation fails with syntax error "Expected end of line but found property"


Script:

tell application "Subler"
    get qitem 1
end tell

Result:

id "F160C164-BA23-4C0A-B84F-C1EC255A28D3" of application "Subler"

Script:

tell application "Subler"
    get id of qitem 1
end tell

Result: execution fails with error "Subler got an error: Can’t get id of qitem 1." number -1728 from id of qitem 1


Script:

tell application "Subler"
    get status of qitem 1
end tell

Result: execution fails with error "Subler got an error: Can’t get status of qitem 1." number -1728 from status of qitem 1


Script:

tell application "Subler"
    get name of qitem 1
end tell

Result: execution fails with error "Subler got an error: Can’t get name of qitem 1." number -1728 from name of qitem 1


Script:

tell application "Subler"
    get sourcePath of qitem 1
end tell

Result: execution fails with error "Subler got an error: Can’t get sourcePath of qitem 1." number -1728 from sourcePath of qitem 1


Script:

tell application "Subler"
    get destinationPath of qitem 1
end tell

Result: execution fails with error "Subler got an error: Can’t get destinationPath of qitem 1." number -1728 from destinationPath of qitem 1

Comments (4)

  1. Damiano Galassi repo owner

    I have no idea how AppleScript works, and the Swift rewrite broke even the small working parts.

    8ad7372 fixes it. Can you compile it and try?

  2. Scott Mann

    This still appears to be broken in Subler 1.5.15 running on 10.14.3.

    It doesn’t appear to be possible to get any properties of any queue items. It is possible to get a total count of queue items, but that’s it.

    tell application "Subler" to get id of queue item 1
    

    Result: error "Subler got an error: Can’t get id of queue item 1." number -1728 from id of queue item 1

    tell application "Subler" to get count of queue items
    

    Result: 45

    Should I create a new ticket, or is it sufficient to reopen this one?

  3. Log in to comment