Can't figure out what's wrong

: I know this is a little long; If you’re anything like
: me, you don’t read scripts without the nice
: formatting Script Editor affords. The problem is–it
: simply doesn’t work. Earlier versions of this did
: work, but I added the properties, and shortened the
: SlideShow() handler about 75% by cutting out if 's
: for each condition, in an attempt to tidy things up,
: make it more elegant, and allow for easy altering of
: the general parameters. This was my first attempt at
: expressions like set without list to
: {“shuffling”, genwithoutList}. I’m just
: winging it, so I’ve probably yet to fully understand
: this, if not other, aspects of the language I’ve
: used here. Another point of confusion, when it gets
: to sending data to JPEGView, the script sends a
: bunch of uncomprehensible characters beginning with
: “acevt” and ending with “end
: tell”. If you replace SlideShow() with something
: like display dialog (withList, withoutList)
: everything seems to be in order! Thank you very
: much if you even just giving it your time.
Hi, Greg.
There are three things here. Firstly, you’re trying to use strings to represent
JPEGView keywords; secondly you’re presenting these strings as lists instead of
individual keywords; thirdly, the way you’re building the lists nests them instead of concatenating them. ie.
:set withoutList to {“shuffling”, genwithoutList}–> {“shuffling”, {“offscreen drawing”, “screen saver”, “recursive scan”, “auto comments”}}You can get round the nested list problem by using the concatenation operator ‘&’
:set withoutList to “shuffling” & genwithoutList–> {“shuffling”, “offscreen drawing”, “screen saver”, “recursive scan”, “auto comments”}As you’re only changing the state of the ‘shuffling’ and ‘user control’ parameters (the others all being fixed in the script), you only need to set up a couple of variables with true or false values for these.
if CommandIsDown then – requires Sändi’s Additions
set shfflng to false – no shuffling
else
set shfflng to true – shufflin
gend if-- or simply
: set shfflng to not (CommandIsDown)
You then using these in the ‘slide show’ command in the SlideShow() handler. The following could be further refined code-wise, but it works
:NG----------

global daTime, shfflng, usrcntrl
on open daList
	if CommandIsDown then -- requires Sändi's Additions
		set shfflng to false -- no shuffling
	else
		set shfflng to true -- shuffling
	end if
	if OptionIsDown then -- requires Sändi's Additions
		set usrcntrl to true -- user control
		set daTime to ""
	else
		SetTime()
	end if
	SlideShow(daList)
end open
on run
	set daFolder to (choose folder with prompt "Choose a folder for a slide show.")
	if button returned of (display dialog "Do you wish the pictures to be shown in order or at random?" buttons {"In Order", "Random"} default button 2) is "Random" then
		set shfflng to true
	else
		set shfflng to false
	end if
	SetTime()
	SlideShow(daFolder)
end run
on SetTime()
	set daTime to text returned of (display dialog "Enter number of seconds to delay, or blank for user control " default answer "15")
	if daTime * 1 then
		set usrcntrl to false
	else
		set usrcntrl to true
	end if
	return
end SetTime
on SlideShow(fileList)
	try
		tell application "JPEGView"
			activate
			slide show fileList ¬
				with delay daTime shuffling shfflng user control usrcntrl ¬
				with images from disk, filenames, no errors, looping, hidden controls and hidden windoids without offscreen drawing, screen saver, recursive scan and auto comments
		end tell
	on error msg
		tell application "JPEGView"
			display dialog msg
			quit
		end tell
	end try
end SlideShow