Jump to content
freshfish

Challenge: phonetic transcript workflow

Recommended Posts

Hello, I'm David, an English teacher. I have a question. I often need to look up the phonetic transcriptions of a word (for example, alfred = /ˈælfrəd/). This can become a laborious task, even when using websites such as photransedit and phonetizer. I was wondering if there were people in this world clever enough to create an Alfred workflow to speed up this process. Ideally, the process would be something like:

 

Invoke Alfred

Type a keyword (such as IPA)

Type dog

*magic*

Press enter to copy phonetic transcription (/dɒɡ/) to clipboard

Navigate to document

Press paste

 

I have no coding ability whatsoever. Could you help with the *magic* part? Let me know if you can :)

 

Thanks,

David

Share this post


Link to post
Posted (edited)

Five years later, if you still need this, I just made one. Note that you need to get your own free API from Oxford Dictionary (max 1000 requests per month for prototype), and then replace the application ID and key with yours.

Edited by johanalfred

Share this post


Link to post
On 7/11/2019 at 3:59 AM, johanalfred said:

Five years later, if you still need this, I just made one. Note that you need to get your own free API from Oxford Dictionary (max 1000 requests per month for prototype), and then replace the application ID and key with yours.

Hello

 

For some reason this is not working for me.  I replaced the ID and key in the main.py file as stated, but it still doesnt work.  Any ideas?

Share this post


Link to post

To follow up, I ran a debug and got this error:

 

Starting debug for 'IPA'

 

[2019-10-22 22:04:35][ERROR: action.script] /bin/bash: line 2: /Users/johan/anaconda3/bin/python: No such file or directory

Share this post


Link to post
5 hours ago, kentmoney said:

To follow up, I ran a debug and got this error:

 

Starting debug for 'IPA'

 

[2019-10-22 22:04:35][ERROR: action.script] /bin/bash: line 2: /Users/johan/anaconda3/bin/python: No such file or directory

 

I'm working on a fix.

Share this post


Link to post
20 hours ago, deanishe said:

A tip, if I may: It would be a good idea to store the APP_ID and APP_KEY in the Workflow Environment Variables table in the workflow's settings and retrieve them in your workflow with os.getenv().


That way, they won't get overwritten when installing a newer version of the workflow.

 

Great, I didn't know that. I'll try to find time to update the workflow. I'm newbie in making Alfred workflows, especially for other users. How is it typically done to ask user to input a key?

 

9 hours ago, kentmoney said:

ok, I have it working now!  Thanks!

 

Is there any way to be able to do multiple words at once? 

 

/θæŋks/!

 

It's not possible using Oxford Dictionary API and it supports searching one word in the dictionary only. I'd suggest using this website

 

Maybe I can make it work with multiple words using this. But that's for another day.

Share this post


Link to post
1 hour ago, johanalfred said:

How is it typically done to ask user to input a key?

 

You can just show a warning in Alfred saying "Go to Alfred Preferences and set an API key".

 

If you want it to be a bit more user-friendly, you can ask the user to enter the API key in Alfred's query box and then save it to the preferences sheet using Alfred's AppleScript API.

Share this post


Link to post
4 hours ago, johanalfred said:

 

Great, I didn't know that. I'll try to find time to update the workflow. I'm newbie in making Alfred workflows, especially for other users. How is it typically done to ask user to input a key?

 

 

It's not possible using Oxford Dictionary API and it supports searching one word in the dictionary only. I'd suggest using this website

 

Maybe I can make it work with multiple words using this. But that's for another day.

 

Yes, that would be very cool! 

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...