Jump to content

Yumin

Member
  • Posts

    2
  • Joined

  • Last visited

Everything posted by Yumin

  1. Thank you for your reply and attempt, @vitor Yes,the app 牛津高阶第9版 is not free and is an English-Chinese version of Oxford Dictionary, so I guess it can only be downloaded in mainland China because of the copyright. Maybe I'm aware of what the problem is, which is that the app is not scriptable, rather than grammar errors. I'd tried to view its scripting dictionary in Script Editor but failed as Fig 1 shown. I also wrote the code below in Script Editor to validate, and it sent back "System Events got an error: Can’t set window "oxford_oalecd9" of process "oxford_oalecd9" to "hello"." So, I suppose I can't write a workflow as planned. Fig 1 set theQuery to "hello" tell application "牛津高阶第9版" activate end tell delay 1 tell application "System Events" tell process "oxford_oalecd9" set value of text field 1 of group 1 of group 2 of group 1 of group 1 of group 1 of group 1 of window "oxford_oalecd9" to theQuery end tell end tell
  2. Hello guys! I love the Alfred functions for Mac build-in dictionary and want to create a workflow like 'Define {query}' for another dictionary app, oxford_oalecd9/牛津高阶第9版. But I'm totally a beginer of Alfred workflow and Apple Script. So, I looked up a lot and learned from others' similar workflows for eudic on the Internet, and started creating one by myself. However, the script seemed to have some errors and I really need your generous help! I used a keyword to run Appe Script and the code are shown in Figure 1. It didn't work at all but I can't see what the problem is... Since the app doesn't function like eudic, I can't code directly like 'show dic with word "{query}". So I found an alternative solution to paste {query} on the input field of the dictionary app. With the help of UI Browser app, I found the location of the input field and set value of it. I think the logic is correct but I'm not confident with the grammar of Apple Script. Can you guys help me to find my bugs? Thanks a lot!
×
×
  • Create New...