Automatic Screenshot Sharing with Hazel

Talk, speculate, discuss, pontificate. As long as it pertains to Hazel.

Moderators: Mr_Noodle, Moderators

Automatic Screenshot Sharing with Hazel Fri Jan 10, 2014 5:29 am • by gaoruijie
I usually use Markdown to write. I want to share the image with Dropbox

I have noticed that there is a method to do the actions

Automatically copy the images to public link

![Hazel rule1](https://www.dropbox.com/s/r1ec9e8j86ibk ... .28.00.png)

![apple scripts](https://www.dropbox.com/s/kswjzvbbbfz7z ... .28.41.png)

My apple scripts

set file_path to theFile as text
try
set text item delimiters to ":"
set file name to last text item of file_path
set text item delimiters to ""
on error
set text item delimiters to ""
end try
set the clipboard to "https://dl.getdropbox.com/u/72877318/screenshots/" & file_name

But there is always showed me with "error executing apple scripts"
gaoruijie
 
Posts: 6
Joined: Sat Dec 21, 2013 12:08 am

Re: Automatic Screenshot Sharing with Hazel Fri Jan 10, 2014 3:31 pm • by Mr_Noodle
Check the logs and post the AppleScript errors here.
Mr_Noodle
Site Admin
 
Posts: 11551
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Automatic Screenshot Sharing with Hazel Mon Jan 13, 2014 12:52 am • by gcoghill
I'm trying to do something similar. I did notice you reference "file_name" in the AppleScript at the end, but earlier you named it "file name".
gcoghill
 
Posts: 290
Joined: Tue Sep 18, 2007 8:09 am
Location: Kent, OH

Re: Automatic Screenshot Sharing with Hazel Mon Jan 13, 2014 12:58 am • by gcoghill
Try this:

Code: Select all
set file_path to theFile as text
try
set text item delimiters to ":"
set file_name to last text item of file_path
set text item delimiters to ""
on error
set text item delimiters to ""
end try
set the clipboard to "https://dl.getdropbox.com/u/72877318/screenshots/" & file_name
gcoghill
 
Posts: 290
Joined: Tue Sep 18, 2007 8:09 am
Location: Kent, OH

Re: Automatic Screenshot Sharing with Hazel Mon Jan 13, 2014 3:53 am • by gaoruijie
gcoghill wrote:Try this:

Code: Select all
set file_path to theFile as text
try
set text item delimiters to ":"
set file_name to last text item of file_path
set text item delimiters to ""
on error
set text item delimiters to ""
end try
set the clipboard to "https://dl.getdropbox.com/u/72877318/screenshots/" & file_name



Thanks, Gcoghill! The problem is fixed.
gaoruijie
 
Posts: 6
Joined: Sat Dec 21, 2013 12:08 am

Re: Automatic Screenshot Sharing with Hazel Mon Jan 13, 2014 9:52 am • by gcoghill
gaoruijie wrote:Thanks, Gcoghill! The problem is fixed.


Great! Glad to help.
gcoghill
 
Posts: 290
Joined: Tue Sep 18, 2007 8:09 am
Location: Kent, OH


Return to Open Discussion