Re: Automator-users Digest, Vol 111, Issue 3
Re: Automator-users Digest, Vol 111, Issue 3
- Subject: Re: Automator-users Digest, Vol 111, Issue 3
- From: Randy Vaughn <email@hidden>
- Date: Wed, 09 Sep 2015 01:42:48 -0700
Sir I just tried to post this on Automator list did it work?
Hello,
September 9, 2015
PLEASE HELP…..THANK YOU!!!!!
I’VE SPENT WEEKS ON THIS
I have on my desktop approximately 100 “Things To Do” icons,
they were created in text/edit and cropped and screenshotted and appear on my desktop.
Because I am UNABLE to remove the FILE NAMES the vertical space they take up is wasted space, if I can get rid of the file names then I can stack all these things to do icons right on top of each other and not waste all that space.
They are .png files,
In view options I already removed “item information” BUT can NOT remove the file NAMES
I AM able to remove the file names if I rename file 1 as SPACE BAR in other words hit the space bar once and the file name COMPLETELY disappears
BUT when I try to rename file 2 I have to hit the space bar TWICE and for the 100 icons I will end up hitting the space bar 100 times on the 100th file or hit the space bar 99 times to get the file name to not appear.
There is supposed to be a way of doing this by making alias, but I am lost on procedure.
I’ve tried selecting the files in finder and right clicking and choosing format dropdown to rename them all “SPACE BAR” but that only sequentially batch renames the files from 0-100 or 1-100
SO I NOW TURN TO AUTOMATOR
I don’t know how to use it REALLY.
Can someone PLEASE offer me SIMPLE instructions on how to remove the file names from these 100 desktop icons, remember they are .png files and each file looks like a white window with ONE thing to do in each box for example “Go To Bank”….100 Icons.
WHAT is the simplest way to do this?……..PLEASE!!!!!!!
1. Space Bar Trick
2. Make Alias Trick
3. Finder Rename Trick
4. Automator Trick
5. Terminal Trick
6. Keyboard Trick
7. 3rd Party App
PLEASE PLEASE PLEASE HELP!!!!!!
THANK YOU!!!!!!!!!!!!!
Sent From My Apple iPhone
> On Sep 7, 2015, at 5:24 AM, email@hidden wrote:
>
> Send Automator-users mailing list submissions to
> email@hidden
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.apple.com/mailman/listinfo/automator-users
> or, via email, send a message with subject or body 'help' to
> email@hidden
>
> You can reach the person managing the list at
> email@hidden
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Automator-users digest..."
>
>
> Today's Topics:
>
> 1. Re: Getting image from web page (Robert Stott)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 07 Sep 2015 12:24:05 +0000 (GMT)
> From: Robert Stott <email@hidden>
> To: Paul Waldo <email@hidden>
> Cc: email@hidden
> Subject: Re: Getting image from web page
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset="utf-8"; Format="flowed"
>
> Hi Paul,
>
> If you're not precious about using Safari then you could do the lot in a shell script:
>
> theImagePath=`curl https://www.packtpub.com/packt/offers/free-learning | grep "bookimage imagecache imagecache-dotd_main_image" | cut -f2 -d"\"" | sed "s/ / /g"`; echo $theImagePath; curl "https:$theImagePath" > ~/Desktop/imagefile.jpg
>
> ...again, a very bare bones example with some work left for you to do. The main possible issue is that it may break if they change the structure of the page. Also, I'm doing a bit of a scruffy bodge to deal with spaces in the file name. However, it should work well enough to demonstrate the general principle.
>
> Rob
>
>
> On Sep 07, 2015, at 12:59 PM, Paul Waldo <email@hidden> wrote:
>
> Thank you, Robert. That script works like a charm! The reason is was pursuing my original line of action was that I would prefer not to have to bring Safari to the foreground to make this work. The use case is that at a specified time, I would be be presented with a simple window saying “Here is the book of the day, do you want it?”. This mode would minimize disruption, rather than all of a sudden Safari popping into the foreground and opening new tabs. The “Get Image URLs from Webpage” did exactly the trick, except for the minor annoyance of not getting the one image I was interested in! I’ll continue pursuing the lesser-disruption route, but your script has gotten me a bit closer. Thanks again!
> ---------------------------------------------
> Paul Waldo
> Photography
> email@hidden
>
>
>
> On Sep 7, 2015, at 4:27 AM, Robert Stott <email@hidden> wrote:
>
> Hi Paul,
>
> I'd probably use an AppleScript action (with an unholy blend of JavaScript and Shell Script lurking within). Something along the lines of:
>
> on run {input, parameters}
>
> --make a path on the local mac to download the image
> set theLocalPath to (POSIX path of (path to desktop)) & "bookimage.jpg"
>
> --load the url into Safari
> tell application "Safari"
> tell front document
> activate
> set URL to "https://www.packtpub.com/packt/offers/free-learning"
> delay 1 --just to give the page time to load. You may need to increase this if you have a slow internet connection.
> set theImagePath to do JavaScript "document.getElementsByClassName('bookimage')[0].src"
> end tell
> end tell
>
> --doanload the image
> set theCMD to "curl " & theImagePath & " > " & theLocalPath
> do shell scripttheCMD
>
> --return the downloaded image as a file
> set theFile to (POSIX filetheLocalPath)
> return theFile
>
>
> end run
>
>
> ...you probably need to do a little tweaking but that should get you started. For example, what to do if the download fails, cleaning up the downloaded image when you've finished etc. I'll leave that for you to have fun with! ;-)
>
> Basically, what it does is load the page up in Safari, run your Javascript to find the image url then download it to your Mac using "curl" in a '"do shell script". Once you have the image file on your Mac you can do as you see fit with it.
>
> Hope that sets you off in the right direction.
>
> Good luck
> Rob
>
> ---
>
> Rob Stott
> www.ghostotter.com
>
>
> On Sep 06, 2015, at 09:39 PM, Paul Waldo <email@hidden> wrote:
>
> Hi all,
>
> I am trying to automate getting an image from a web page and am scratching my head. Here is an outline of what I am intending to do: Packt Publishing gives away a free technical eBook every day. Some have topics of interest, while others do not. I want to create a workflow that will retrieve the book image and ask me if I want to get it. If I say yes, it will select the book to be placed in my online library with Packt.
>
> My initial try was to use a “Get Specified URLs” action with the address https://www.packtpub.com/packt/offers/free-learning. I then use “Get Image URLs from Webpage” and it returns a number of images. For some reason, the image of the book available that day is not in the list, while many of the supporting images are.
>
> While this seems like the most straightforward approach, it doesn’t seem to work. I have found that I can get the image by executing the javascript "document.getElementsByClassName('bookimage')[0].src”. It is unclear though how to implement that knowledge. I have tried the “Run JavaScript” action, but I don’t see how to pass in the DOM of the web page.
>
> Any thoughts on a better way to handle this or on either of the specific problems above would be greatly appreciated!
>
> PS
> If you are not familiar with Packt, I would recommend checking them out. Their books are of good quality and they free book each day has a little something for everyone.
> ---------------------------------------------
> Paul Waldo
> Photography
> email@hidden
>
> <twitter-1.png><flickr-2.png>
>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.apple.com/archives/automator-users/attachments/20150907/ad11eff3/attachment.html>
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: twitter-1.png
> Type: image/png
> Size: 4326 bytes
> Desc: not available
> URL: <http://lists.apple.com/archives/automator-users/attachments/20150907/ad11eff3/attachment.png>
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: flickr-2.png
> Type: image/png
> Size: 2528 bytes
> Desc: not available
> URL: <http://lists.apple.com/archives/automator-users/attachments/20150907/ad11eff3/attachment-0001.png>
>
> ------------------------------
>
> _______________________________________________
> Automator-users mailing list
> email@hidden
> https://lists.apple.com/mailman/listinfo/automator-users
>
>
> End of Automator-users Digest, Vol 111, Issue 3
> ***********************************************
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Automator-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden