I like going to bing.com due to the great images that are featured on the webpage, that change daily. For Windows 10, there's even a Bing Wallpapers app that will put the Bing Image of the Day as your computer screen's desktop wallpaper. Unfortunately, for Windows 7 and Mac users, there is no official app that can do this.
For Macs, there is an app in the App Store called Bing Wallpaper or something like that, that costs $4.99. I did some research and created my own app to accomplish this using a Python script and iCal Automator event. I have never used Python before but have made iCal events. Here's what I did:
I got a Python script called bing.py from:
https://github.com/declangao/Bing-Wallpaper-for-Mac
Thanks, declangao! Here's the description:
"A simple Python script capable of batch-downloading and setting Bing picture of the day as wallpaper on your Mac OS X."
I then did some research on how to run a Python script on my Mac. It was easy. I learned a bit about MS-DOS and command lines back in my college undergrad days, so I know how to use Teminal commands on a Mac.
To run a Python script on a Mac using Terminal:
change directory to your desktop: cd Desktop
run the Python script: Python bing.py (or your own simpler filename.py) [.py file must be on Desktop]
I ran the Python script and my Mac wallpaper did indeed change to the current day's Bing wallpaper. So the script worked!
Next:
To create a Python Unix executable file, that opens a new Terminal window and executes a Python file: generally follow these directions:
https://martechwithme.com/convert-python-script-app-windows-mac/#formac
https://martechwithme.com/schedule-python-scripts-windows-mac/#formac
martechwithme.com's directions had me create a new text file and input these lines:
#!/bin/sh
Python /Users/norbertwu/Documents/Python_test/test.py [I created a folder called Python_test in the Documents folder]
then save the file to the folder Python_test, save without an extension
in Terminal: enter "chmod 755 /Users/norbertwu/Documents/Python_test/test
This changes the permissions for the file so that it becomes a Unix executable file. However, I discovered that I needed to add the extension ".command" to this file, so that this would open a new Terminal window and execute the python commands.
So my steps were:
create a file called test_python and put the following text in it:
#!/bin/sh
Python /Users/norbertwu/Desktop/test.py [wherever the python script is located]
In Terminal, do the command chmod 755 on the test_python file.
Then rename the test_python file to test_python.command.
Done! By double-clicking the test_python.command file, a new Terminal window is opened and the Python script executes.
I opened the bing.py file and saw the first line was: #!/usr/bin/env python
So all I did was go to Terminal: cd Desktop [the file bing.py was on the Desktop]
chmod 755 bing.py
Then I changed bing.py file to bing.command (actually bingtest.command).
Thus, bing.command became an executable file.
Next, I used Automator:
martechwithme.com writes: Finally, if you want a real application file instead of a simple Unix executable that you will be able to schedule, we can do so by launching Automator.
Launch Automator: After launching the program, choose to create an “Application”.
In the list of actions on the left side, get the parameter “Get Specified Finder Items”. Once you added it to your right panel in Automator, you should be able to “Add” an item to this action. At this point, you want to browse through your files and select your Unix Executable.
After that, we need to add a new action, namely “Open Finder Items”. This will trigger to open the file selected previously in its default application.
All that’s left is to save. Choose a name that you will recognize and you will now have your own .app file ready to be launched!
I ended with an Automator file called changeBingWallpaper.app which just runs the bing.py executable file.
You can create an iCal event that will run an AppleScript or Automator action at a given time, and have that event repeat at the same time every day.
I then created an iCal event (can do it in iCal or Automator): let's do it in Automator:
https://martechwithme.com/schedule-python-scripts-windows-mac/#formac has tips:
choose Automator, then New file -- Calendar Alarm.
This will create a separate calendar overlay in iCal, and put an event in there.
We then need to add an Alert. A “Custom” one precisely, following the screenshot below:
A Custom Alert allows us to set a different action at the time of event. One of these actions is “Open a file”
Choose the file .app you would wish to open once the event is triggered and set the “Alert” to trigger “At time of event”
Finally and to ensure that scripts are launched periodically, it is time to define the “Repeat” setting of the event.
You can hide the Automator calendar overlay, or show it, as you wish.
This opened a Terminal window every day at 8am, ran the Documents/Python_scripts/bingtest.command file and then left the Terminal window open.
To close the "hanging" Terminal window: I went to Terminal preferences: choose "close when script exits."
I did not want a notification window or to see the iCal window after this iCal event, so I did the following:
no iCal notifications in System Preferences and/or in the iCal Automator calendar, right click, turn off Alerts
There are a ton of other ways to do this, involving various programs like LaunchControl, etc.
You can create an iCal event that will run an AppleScript or Automator action at a given time, and have that event repeat at the same time every day.
I then created an iCal event (can do it in iCal or Automator): let's do it in Automator:
https://martechwithme.com/schedule-python-scripts-windows-mac/#formac has tips:
choose Automator, then New file -- Calendar Alarm.
This will create a separate calendar overlay in iCal, and put an event in there.
We then need to add an Alert. A “Custom” one precisely, following the screenshot below:
A Custom Alert allows us to set a different action at the time of event. One of these actions is “Open a file”
Choose the file .app you would wish to open once the event is triggered and set the “Alert” to trigger “At time of event”
Finally and to ensure that scripts are launched periodically, it is time to define the “Repeat” setting of the event.
You can hide the Automator calendar overlay, or show it, as you wish.
This opened a Terminal window every day at 8am, ran the Documents/Python_scripts/bingtest.command file and then left the Terminal window open.
To close the "hanging" Terminal window: I went to Terminal preferences: choose "close when script exits."
I did not want a notification window or to see the iCal window after this iCal event, so I did the following:
no iCal notifications in System Preferences and/or in the iCal Automator calendar, right click, turn off Alerts
There are a ton of other ways to do this, involving various programs like LaunchControl, etc.