Jump to content

jerik

Member
  • Posts

    4
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

jerik's Achievements

Helping Hand

Helping Hand (3/5)

0

Reputation

  1. Hi, I have a bash script "todo" which launches basically vim with my "journal.txt" file. When running the script form shell it works as expected. -> If a vim gui is running, i send a command to vim to call a function (which opens my journal.txt) -> If no vim gui is running, vim will be started with the call to the function as startup parameter. I can run the script repetitive within the shell and it works fine. I have setup a workflow with a hotkey and an assigned action with "run script" (/bin/bash). In the "run script" I call this "todo" script. When hitting the hotkey the first time, the script will be executed fine. # I see the execution of the script in my logfile When hitting the hotkey again (2), nothing happens. When hitting the hotkey again (3), nothing happens. When I now close vim. Vim will be opened again with the file "journal.txt". # I see the execution of the script in my logfile When I close vim again. Vim will be opened again with the file "journal.txt". # I see the execution of the script in my logfile Somehow Alfred seems to hold back the execution of the script, when I hit the hotkey, when the script is running already. How can I get rid of the holding back? The script shall be executed when the hotkey is triggered. The executed script "todo" #!/usr/bin/env bash set -o nounset set -o errexit # Normal log: write_log 0 message to show # Error log: write_log E message to show function write_log() { msgType="Info - " if test "$1" != "0"; then msgType="Error - " fi shift logMsg="$(basename $0): $msgType $@" logger $logMsg echo $logMsg } mvim=/usr/local/bin/mvim function run_vim() { if [ "$1" == 'o' ]; then func=Nextv2Todos else func=Journal fi write_log 0 run_vim with $func if [ $(/bin/ps aux | /usr/local/bin/rg -c \/Vim) -gt 1 ]; then # https://vi.stackexchange.com/a/318 $mvim --remote-send ":call ${func}()<cr>" write_log 0 remote-send else $mvim -c ":call ${func}()" write_log 0 normal call fi } # run: todo -c or todo -o while getopts "a:hvtoc-" options; do # a) a=$OPTARG;; case $options in o) run_vim $options; exit 1;; c) run_vim $options; exit 1;; h) usage; exit 1;; *) usage; exit 1;; esac done Here my workflow <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>bundleid</key> <string>com.alfredapp.jerik.journalhotkey</string> <key>category</key> <string>Productivity</string> <key>connections</key> <dict> <key>D0D170CF-42DF-4377-8032-B69D1C04AE97</key> <array> <dict> <key>destinationuid</key> <string>8B67BA2C-870A-4D05-B32A-EEBB5851DF6B</string> <key>modifiers</key> <integer>0</integer> <key>modifiersubtext</key> <string></string> <key>vitoclose</key> <false/> </dict> </array> </dict> <key>createdby</key> <string>jerik</string> <key>description</key> <string></string> <key>disabled</key> <false/> <key>name</key> <string>journal current</string> <key>objects</key> <array> <dict> <key>config</key> <dict> <key>action</key> <integer>0</integer> <key>argument</key> <integer>0</integer> <key>focusedappvariable</key> <false/> <key>focusedappvariablename</key> <string></string> <key>hotkey</key> <integer>38</integer> <key>hotmod</key> <integer>393216</integer> <key>hotstring</key> <string>J</string> <key>leftcursor</key> <false/> <key>modsmode</key> <integer>0</integer> <key>relatedAppsMode</key> <integer>0</integer> </dict> <key>type</key> <string>alfred.workflow.trigger.hotkey</string> <key>uid</key> <string>D0D170CF-42DF-4377-8032-B69D1C04AE97</string> <key>version</key> <integer>2</integer> </dict> <dict> <key>config</key> <dict> <key>concurrently</key> <false/> <key>escaping</key> <integer>102</integer> <key>script</key> <string>/Users/jerik/workspace/bins/sunix/todo -c</string> <key>scriptargtype</key> <integer>1</integer> <key>scriptfile</key> <string></string> <key>type</key> <integer>0</integer> </dict> <key>type</key> <string>alfred.workflow.action.script</string> <key>uid</key> <string>8B67BA2C-870A-4D05-B32A-EEBB5851DF6B</string> <key>version</key> <integer>2</integer> </dict> </array> <key>readme</key> <string></string> <key>uidata</key> <dict> <key>8B67BA2C-870A-4D05-B32A-EEBB5851DF6B</key> <dict> <key>xpos</key> <integer>400</integer> <key>ypos</key> <integer>50</integer> </dict> <key>D0D170CF-42DF-4377-8032-B69D1C04AE97</key> <dict> <key>xpos</key> <integer>50</integer> <key>ypos</key> <integer>50</integer> </dict> </dict> <key>variablesdontexport</key> <array/> <key>version</key> <string></string> <key>webaddress</key> <string></string> </dict> </plist>
  2. Hi @Vero, it's a kind of tricky issue. It seems only to appear in the application-top-bar where you can rename your file, see https://imgur.com/a/s2sgdaV. And there it is not 100% to reproduce, but often. What I found out, so far. It seems only to appear in the application-top-bar where you can rename your file It seems to happen only on snips where I use placeholders. {date:yyyyMMdd} and {date:yyyy-MM-dd} On normal snip which replaces only text I could not reproduce it It seems to happen on the first tries. E.g. I try serveral snips with placeholder to rename my file If I use first a snip which replaces only text then, it will not happen when I use a snip with placeholder thereafter If it worked once correctly (with a snip with placeholder), I cannot reproduce it anymore (in this session) My use case "to replace filenames (of pdf files) on the application-top-bar" do I use several times a month. That's why I discovered this fuzzy behaviour. With my findings, I will try to use the workaround to first try a snip with text replacement, and then it should work (as I cannot reproduce it). On Textedit it works fine. I have BetterTouchTool installed, but I do not use their clipboard manager. I just discovered that they have a clipboarmanager, when I wrote this post Cheers -- jerik
  3. Hi, I created a snippet in Alfred. When I use it an unwanted space before the string is placed. As I use the snippet to name my files they get messed up through that fuzziness. When I sort these files, due to the space at the beginning, they are at the place I expect them Here you will find my snippet and an video of the fuzziness. https://imgur.com/a/s2sgdaV cheers -- jerik
×
×
  • Create New...