• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Picture not aways replaced
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Picture not aways replaced


  • Subject: Re: Picture not aways replaced
  • From: "koenig.yvan" <email@hidden>
  • Date: Mon, 06 Jan 2014 19:05:13 +0100


Le 05/01/2014 à 16:02, Robert Poland <email@hidden> a écrit :

Hi,

Below is a piece of a script I use to change all desktop “Spaces” to the same picture.

The problem I’m running into is that if the current picture has the same name as the newer one (maybe it was modified), it is not replaced.

Any ideas?

— Script
tell application "System Events" to key code 18 using {control down} -- Desktop 1
delay 1
repeat (numSpaces) times
tell application "System Events"
tell current desktop
set picture to ThePicture
tell me to beep # Edited this way to get rid of non fatal error -1708
end tell
delay 1
-- switch to the next desktop
tell application "System Events" to key code 124 using {control down} -- ^→
delay 1
end tell -- application "System Events"
end repeat
beep 2
tell application "System Events" to key code 18 using {control down} -- Desktop 1
— end of Script

TIA,

Robert Poland - Fort Collins, CO



The system compares only the new pathname to the in use one.
When they are the same, it "think" that you are trying to reinstall the in use one and do nothing.

Try to use this edited version :

— Script
tell application "System Events" to key code 18 using {control down} -- Desktop 1
delay 1
repeat (numSpaces) times
tell application "System Events"
tell current desktop
set picture to path2fakePicture # ADDED
delay .2 # ADDED

set picture to ThePicture
tell me to beep # Edited this way to get rid of non fatal error -1708
end tell
delay 1
-- switch to the next desktop
tell application "System Events" to key code 124 using {control down} -- ^→
delay 1
end tell -- application "System Events"
end repeat
beep 2
tell application "System Events" to key code 18 using {control down} -- Desktop 1
— end of Script

path2fakePicture is supposed to be the pathname of a picture file which you never use as a background.
Maybe a nil string "" would do the trick but I'm not sure.
The delay may be too short.

Yvan KOENIG (VALLAURIS, France) lundi 6 janvier 2014 19:04:48


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Picture not aways replaced (From: Robert Poland <email@hidden>)

  • Prev by Date: Re: MorningStartUp script
  • Next by Date: Re: Picture not aways replaced
  • Previous by thread: Re: Picture not aways replaced
  • Next by thread: Re: AppleScript-Users Digest, Vol 11, Issue 5
  • Index(es):
    • Date
    • Thread