Jump to content
CarlosNZ

Tiny PNG workflow [Updated to v1.2]

Recommended Posts

Good tip, Vero.

I've edited the script to not change filenames. The compressed images get downloaded to a different folder, so they won't clash, and now I don't have to rename the files before replacing the originals.

Share this post


Link to post

Hi Carl, 

first of all thanks a lot for your plugin... it's awemsome.

Now, with el Capitan i switch to pathfinder... can help me to convert the script to read the path finder file?

thanks a lot 

Elia

Share this post


Link to post

Hi,

 

I'm a newbie with workflows and don't know where to put the API code.

I go to: tinypng_config within the workflow and see /bin/bash

 

key="{query}"
 
#Storage directory for API key
PREFS="$HOME/Library/Application Support/Alfred 2/Workflow Data/carlosnz.tinypng"
 
#Create storage folder
mkdir -p "$PREFS"
 
#Save user's key to storage file
echo "$key">"$PREFS/api_key"
 
#Notify
echo "New API key applied:"$'\n'"$key"
 
 
Where can I put the API?
 
Best regards,
Hendrik

 

Share this post


Link to post

You don't need to go to tinypng_config in the workflow... just start typing tiny into Alfred and you will be provided with three options. One option will be "Enter/Change API Key". Choose this option and it will prompt for your API key. Paste your key, hit return and you should be good to go.

 

Hi,

 

I'm a newbie with workflows and don't know where to put the API code.

I go to: tinypng_config within the workflow and see /bin/bash

 

key="{query}"
 
#Storage directory for API key
PREFS="$HOME/Library/Application Support/Alfred 2/Workflow Data/carlosnz.tinypng"
 
#Create storage folder
mkdir -p "$PREFS"
 
#Save user's key to storage file
echo "$key">"$PREFS/api_key"
 
#Notify
echo "New API key applied:"$'\n'"$key"
 
 
Where can I put the API?
 
Best regards,
Hendrik

 

Share this post


Link to post

Anyone on High Sierra (GM) using this workflow?

Mine has stopped working.

I use it every day as well :(

 

The report just states:

FILE: /Users/me/Documents/Temp/test4.png
Problem downloading test4_shrink.png

Share this post


Link to post
1 hour ago, funkymonkey said:

Anyone on High Sierra (GM) using this workflow?

Mine has stopped working.

I use it every day as well :(

 

The report just states:

FILE: /Users/me/Documents/Temp/test4.png
Problem downloading test4_shrink.png

 I'll check it out once I install HS later this week. Thanks.

Share this post


Link to post
1 hour ago, CarlosNZ said:

 I'll check it out once I install HS later this week. Thanks.

 

Hey, this is not related to the HS issue but once you look into it remember to change the location of the data folder by adopting the environment variable instead of hard coding the path, since Alfred 2 and 3 have different locations for persistent data. So you can use this:

 

#Storage directory for API key
PREFS="$alfred_workflow_data"

Share this post


Link to post
On 9/25/2017 at 7:15 AM, funkymonkey said:

Anyone on High Sierra (GM) using this workflow?

Mine has stopped working.

I use it every day as well :(

 

The report just states:

FILE: /Users/me/Documents/Temp/test4.png
Problem downloading test4_shrink.png

 

It's working for me on the first public release.

Share this post


Link to post

I completely uninstalled it then reinstalled and set it up from scratch.

 

Working now! :)

 

I wondered if the location I had set had something to do with it. i.e. I had changed the default location from desktop to another folder. Then updated macOS (obviously including new file system) then it broke. Anyway it works now (with the previous location change).

Share this post


Link to post

if It doesn't work with alfred3 

try to fix tinypng_config script 

 

PREFS="$HOME/Library/Application Support/Alfred 3/Workflow Data/carlosnz.tinypng"

 

It may be Alfred 2 folder in your setting

Edited by flatcoke

Share this post


Link to post
3 hours ago, flatcoke said:

if It doesn't work with alfred3 

try to fix tinypng_config script 

 

PREFS="$HOME/Library/Application Support/Alfred 3/Workflow Data/carlosnz.tinypng"

 

It may be Alfred 2 folder in your setting

 

Changing the data folder path will not fix any issue with the workflow. Additionally, hard-coding the data folder path is not a good practice as you can use the environment variable like I told four posts above yours:

 

 

Edited by xilopaint

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...