Re: Choose not working
Re: Choose not working
- Subject: Re: Choose not working
- From: Robert Poland <email@hidden>
- Date: Thu, 12 Jun 2014 16:25:42 -0600
Thanks Christopher and Ron,
My response is scattered in the following. On Jun 12, 2014, at 2:24:PM, Ron Hunsinger < email@hidden> wrote: On Jun 12, 2014, at 10:35 AM, Robert Poland <email@hidden> wrote:
At the beginning of a script I have this;
set nullPicture to "~/Pictures/APOD ƒ/nullPicture.jpg" # Temp blank image set ThePicture to choose file delay 1 tell application "System Events" to set the_size to size of disk item (ThePicture as text)
This has been working for ages, now I get errors…
Can't get «class ditm» "/Users/rpoland/Pictures/ APOD f /140611-galaxies_mackivne n_2 000-1 ,jpg" of application "System Events",
The file "140611-galaxies_mackivne n_2 000-1 ,jpg” was removed yesterday and no longer exists. AND is not the file I “Chose”.
Any special reason you're getting a (comma)jpg in the file name instead of a (dot)jpg?
Since OS 9.3 can’t get text from an error message I used OCR to copy it (sort of).
Are you sure the error message is coming from the line you're looking at? You may have "1406110galaxies-mackiven n_2 000-1.jpg" somewhere else (perhaps as a property) and reference it further down in the script.
You were right.
It came from;
tell application "System Events" set backGroundPath to (picture of current desktop) # returns an Unix path
set backGroundName to name of disk item result
The offending image was on a desktop but no longer in RAM.
COMMENT; OS 10.9.3 really screws with the desktop images with multiple Spaces. It's odd that you appear to have a folder "APOD ƒ", but the error message refers to folder "APOD f". I don't know if that's a clue or merely a transcription error.
See OCR comment above. I have not restarted the computer yet.
Why not? It's astonishing how often inscrutable errors are fixed by a simple restart.
I agree, but that didn’t help. Just as a matter of style (and not related to your problem):
tell application "System Events" to set the_size to size of disk item (ThePicture as text)
is unnecessarily roundabout. "ThePicture" is already an alias. No need to convert it to text and then back to a disk item. Just say:
tell application "System Events" to set the_size to size of ThePicture
I implemented this. -Ron Hunsinger
Robert Poland Fort Collins CO
|
_______________________________________________
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