Giter Club home page Giter Club logo

Comments (27)

cgpro avatar cgpro commented on May 9, 2024 2

Same issue here. If I type "lor" and accept the first option "paragraphs" a google search will be started.

Expected behaviour:
Copy a lorem text into clipboard. ;-)

from alfred-lorem-ipsum.

rverrips avatar rverrips commented on May 9, 2024 1

Just to confirm @ruudvanham - you are saying your issue was fixed by using the latest version (v0.2.1) of the workflow?

Also, @wirtzdan : Is your issue resolved with the update to v0.2.1?

from alfred-lorem-ipsum.

rverrips avatar rverrips commented on May 9, 2024

I had this exact issue a few days ago and Till released a new version to fix it.
Which version are you running?

#5

from alfred-lorem-ipsum.

ruudvanham avatar ruudvanham commented on May 9, 2024

Same issue here, just updated alfred and imported the latest workflow. v0.2.1

from alfred-lorem-ipsum.

tillkruss avatar tillkruss commented on May 9, 2024

I'm confused too.

from alfred-lorem-ipsum.

ruudvanham avatar ruudvanham commented on May 9, 2024

No sorry, i'm still having the issue, even after updating alfred and the workflow to the latest versions

from alfred-lorem-ipsum.

tillkruss avatar tillkruss commented on May 9, 2024

What's your Alfred and macOS version?

from alfred-lorem-ipsum.

ruudvanham avatar ruudvanham commented on May 9, 2024

Alfred: v4.6.1 [1274]
Lorem Ipsum: v0.2.1
MacOs: Monterey 12.0.1

from alfred-lorem-ipsum.

tillkruss avatar tillkruss commented on May 9, 2024

@ruudvanham @cgpro Are you two on Intel or M1 chips?

Do you have have PHP installed via Homebrew?

from alfred-lorem-ipsum.

cgpro avatar cgpro commented on May 9, 2024

Nope:
macOS MOnterey (12.0.1)
iMac (Retina 5K i7 end 2015 > Intel)

$ php -v PHP 7.4.12 (cli) (built: Nov 30 2020 13:28:43) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies

Don't know how I installed this PHP-Version anymore.

from alfred-lorem-ipsum.

tillkruss avatar tillkruss commented on May 9, 2024

Could you run which php for me to reveal the path?

from alfred-lorem-ipsum.

cgpro avatar cgpro commented on May 9, 2024

It's the version from MAMP
$ which php php: aliased to /Applications/MAMP/bin/php/php7.4.12/bin/php -c "/Library/Application Support/appsolute/MAMP PRO/conf/php7.4.12.ini"

from alfred-lorem-ipsum.

tillkruss avatar tillkruss commented on May 9, 2024

Can you go into your workflow and try this script instead?

if [ -f "/opt/homebrew/bin/php" ]; then
    /opt/homebrew/bin/php loremipsum.php "words" "{query}"
elif [ -f "/usr/local/bin/php" ]; then
    /usr/local/bin/php loremipsum.php "words" "{query}"
elif [ -f "/usr/bin/php" ]; then
    /usr/bin/php loremipsum.php "words" "{query}"
else
    php loremipsum.php "words" "{query}"
fi

from alfred-lorem-ipsum.

cgpro avatar cgpro commented on May 9, 2024

Nope, after typing 'lorem words' alfred want to perform a google search.

Bildschirmfoto 2021-12-09 um 19 36 46

If I type 'lorem wor':

Bildschirmfoto 2021-12-09 um 19 45 43

If you want, we can do a call with screen sharing, if you can't reproduce it. Maybe its a setting? (not changed/updated after an update maybe)

from alfred-lorem-ipsum.

tillkruss avatar tillkruss commented on May 9, 2024

When you debug the workflow in Alfred, are you seeing any errors?

Screen Shot 2021-12-10 at 9 07 41 AM

from alfred-lorem-ipsum.

cgpro avatar cgpro commented on May 9, 2024

This works in combination Language /bin/zsh (and not bin/bash)

if [ -f "/opt/homebrew/bin/php" ]; then /opt/homebrew/bin/php loremipsum.php "words" "{query}" elif [ -f "/usr/local/bin/php" ]; then /usr/local/bin/php loremipsum.php "words" "{query}" elif [ -f "/usr/bin/php" ]; then /usr/bin/php loremipsum.php "words" "{query}" else /Applications/MAMP/bin/php/php7.4.12/bin/php loremipsum.php "words" "{query}" fi

Bildschirmfoto 2021-12-10 um 20 38 27

from alfred-lorem-ipsum.

tillkruss avatar tillkruss commented on May 9, 2024

@cgpro: Can you post the raw output of which php? Ideally a screenshot of your terminal?

from alfred-lorem-ipsum.

cgpro avatar cgpro commented on May 9, 2024

Bildschirmfoto 2021-12-14 um 20 16 52

from alfred-lorem-ipsum.

nicooprat avatar nicooprat commented on May 9, 2024

I had to manually replace the script PHP location:

% which php
/opt/homebrew/opt/[email protected]/bin/php

image

I'm not familiar with bash scripts, but it would be better to avoid hardcoding every possible PHP location in the script itself... Can't we use the output of which php to use it right away?

Anyway for now it works again, hope it helps.

from alfred-lorem-ipsum.

tillkruss avatar tillkruss commented on May 9, 2024

@nicooprat: I don't think we can, but we can use it as the fallback.

if [ -f "/opt/homebrew/bin/php" ]; then
    /opt/homebrew/bin/php loremipsum.php "words" "{query}"
elif [ -f "/usr/local/bin/php" ]; then
    /usr/local/bin/php loremipsum.php "words" "{query}"
elif [ -f "/usr/bin/php" ]; then
    /usr/bin/php loremipsum.php "words" "{query}"
else
    php loremipsum.php "words" "{query}"
fi

Can you give this one a try if it works?

from alfred-lorem-ipsum.

rverrips avatar rverrips commented on May 9, 2024

This might be an option - I tested with this on my Mac and it worked ok.

Should however add an else for error catching.

if [ -f "$(which php)" ]; then
    $(which php) loremipsum.php "words" "{query}"
fi

from alfred-lorem-ipsum.

nicooprat avatar nicooprat commented on May 9, 2024

@rverrips Could you explain what you did exactly? I just tried it (with bash & zsh), but with no luck:

$(which php) loremipsum.php "words" "{query}"

image

from alfred-lorem-ipsum.

tillkruss avatar tillkruss commented on May 9, 2024

@rverrips /bin/bash may not have php in its PATH.

from alfred-lorem-ipsum.

tillkruss avatar tillkruss commented on May 9, 2024

I wonder if this would cover enough cases:

if [ -f "/opt/homebrew/bin/php" ]; then
    /opt/homebrew/bin/php loremipsum.php "words" "{query}"
elif [ -f "/usr/local/bin/php" ]; then
    /usr/local/bin/php loremipsum.php "words" "{query}"
elif [ -f "/usr/bin/php" ]; then
    /usr/bin/php loremipsum.php "words" "{query}"
elif [ -f "$(which php)" ]; then
    $(which php) loremipsum.php "words" "{query}"
else
    php loremipsum.php "words" "{query}"
fi

That would allow people to link php as an alias even.

from alfred-lorem-ipsum.

rverrips avatar rverrips commented on May 9, 2024

@rverrips Could you explain what you did exactly? I just tried it (with bash & zsh), but with no luck:

$(which php) loremipsum.php "words" "{query}"

image

Apologies @nicooprat and @tillkruss ... My hope was that $(which php) would execute the string returned from (which php), i.e. current php binary.

This works in "regular" bash, sh and zsh, but seems this does not work within the Alfred script execution - Apologies for the wild goose chase

Like the issues we have with various paths to php, it seems Alfred can't find which either ... sigh

(Please disregard my suggestion to use $(which php))

from alfred-lorem-ipsum.

tillkruss avatar tillkruss commented on May 9, 2024

The /bin/bash used by Alfred seems capable of which php and command -v php, but php may not be in the bash path.

from alfred-lorem-ipsum.

tillkruss avatar tillkruss commented on May 9, 2024

I've tweaked this in v0.2.2. Please re-open if the issue persists.

from alfred-lorem-ipsum.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.