Jump to content

Urs Schwaller

Member
  • Content Count

    3
  • Joined

  • Last visited

  • Days Won

    1

Urs Schwaller last won the day on October 6 2017

Urs Schwaller had the most liked content!

About Urs Schwaller

  • Rank
    Newbie
  1. props go to @developdude (https://github.com/psistorm/alfredapp/issues/22) you just have to change http to https in leo.php (line 19) and then restart alfred. to find the file just open any of the scripts inside the workflow and then click on "open workflow folder".
  2. solved it myself! sorry for the post! :/ solution was to put "ApplicationIsRunning" outside of "alfred_script" on ApplicationIsRunning(appName) tell application "System Events" to set appNameIsRunning to exists (processes where name is appName) return appNameIsRunning end ApplicationIsRunning on alfred_script(q) if ApplicationIsRunning("Telegram") then tell application "Telegram" to quit delay 0.1 tell application "Telegram" to activate delay 0.1 tell application "System Events" to tell process "Telegram" to keystroke "Test" delay 0.1 tell application "System Events" to tell process "Telegram" to keystroke (ASCII character 31) else tell application "Telegram" to activate delay 0.1 tell application "System Events" to tell process "Telegram" to keystroke "Test" delay 0.1 tell application "System Events" to tell process "Telegram" to keystroke (ASCII character 31) end if end alfred_script
  3. Hi everybody I'm really new to writing alfred workflows and also to applescript and I'm stuck ... I wrote a really small and simple script to write from alfred to the messaging app "Telegram". The script works fine when I run it in the Script editor but when I run it in Alfred I get the following Error: [ERROR: alfred.workflow.action.applescript] { NSAppleScriptErrorBriefMessage = "Expected \U201cend\U201d but found \U201con\U201d."; NSAppleScriptErrorMessage = "Expected \U201cend\U201d but found \U201con\U201d."; NSAppleScriptErrorNumber = "-2741"; NSAppleScriptErrorRange = "NSRange: {20, 2}"; } Here is my AppleScript: on alfred_script(q) on ApplicationIsRunning(appName) tell application "System Events" to set appNameIsRunning to exists (processes where name is appName) return appNameIsRunning end ApplicationIsRunning if ApplicationIsRunning("Telegram") then tell application "Telegram" to quit delay 0.1 tell application "Telegram" to activate delay 0.1 tell application "System Events" to tell process "Telegram" to keystroke "Test" delay 0.1 tell application "System Events" to tell process "Telegram" to keystroke (ASCII character 31) else tell application "Telegram" to activate delay 0.1 tell application "System Events" to tell process "Telegram" to keystroke "Test" delay 0.1 tell application "System Events" to tell process "Telegram" to keystroke (ASCII character 31) end if end alfred_script I guess it's a stupid mistake for you guys but I'm really stuck and haven't found anything online to solve it :/
×
×
  • Create New...