quark postscript: wrong loop?

Is it possible to send and receive info to a web site using AS? I’m trying to see if I can make a basic AS application that acts like a simplified interface to a web site. I cannot figure out how to send loggin info to the site (fill in forms) and (choose) extract the media files from a clickable list.

I can download a known file and check for site changes periodically. Should I use another language to give an AS this functionality? BTW, security is not an issue.

Here is a still-unpublished entry for our FAQ:

So, ask! (the best approach is show us the related page, so we can see and study the html code, if you don’t know nothing about javascript, web apps, url-encoding, etc.)

I didn’t quite get the results I expected, but I’m going to read the Man Pages to see what I can figure out beyond this.

Here’s my basic attempt to slightly alter your example code and the results (errors)

CODE

→ submit POST data
set remoteApp to “http://www.pagoo.com/asp/mc/ICWLogin.asp?Direction=ICWAccountInfo
set URLEncodedVars to “var1=7150000000&var2=0000”
do shell script "curl -d " & URLEncodedVars & space & remoteApp

→ submit GET data
do shell script “curl http://www.pagoo.com/asp/mc/ICWLogin.asp?Direction=ICWAccountInfo var1=a&var2=b”

Results

tell current application
do shell script “curl -d var1=7154261637&var2=0000 http://www.pagoo.com/asp/mc/ICWLogin.asp?Direction=ICWAccountInfo
"sh: line 1: http://www.pagoo.com/asp/mc/ICWLogin.asp?Direction=ICWAccountInfo: No such file or directory
curl: no URL specified!
curl: try ‘curl --help’ for more information

To give more details on my project here’s the web site
http://www.pagoo.com/asp/mc/ICWLogin.asp?Direction=ICWAccountInfo

This is Pagoo, an answering service while your online when using a dialup connection.

I figure posting data like I would by hand using a script is still just as secure. I’m looking at Making a AS app that will allow me to store basic prefs like phone (VAR1) and id (VAR2) and start at boot and connect when connect to the internet. The script would monitor my pagoo web page that will list incoming calls and then the app will then play the voice message upon arrival.

My attempt, is to make an AS app to replace Pagoo’s Classic monitoring app so it does not cause system conflicts with OSX. It is the only classic app I own I cannot get a hold of anyone at pagoo so I thought this would be good time to learn how to program on my Mac.

Simply quote the data:

(*
form stuff
action
<form method = post> (no action, so the  remote application is the same asp page)
vars
<input type="text" name="PagooID" maxlength=20 value=>
<input type="text" name="Password" maxlength=20 value=>
<INPUT TYPE = HIDDEN NAME="Direction" VALUE = 'ICWAccountInfo'>
*)

set remoteApp to quoted form of "http://www.pagoo.com/asp/mc/ICWLogin.asp"
set URLEncodedVars to quoted form of "PagooID=0000000000&Password=0000&Direction=ICWAccountInfo"
do shell script "curl -d " & URLEncodedVars & space & remoteApp

As you see, we don’t use really “var1” or “var2”, but the name of the related fields (text and hidden fields owned by this form, as you can see exploring the html code).
It must work, since I receive a “Wrong password or id” message…

Hi!!

The following dropletscript generates postscriptfiles of every quarkdoc dropped on it. If i drop 4 quarkdocuments on it, only the first is generated the right way and the next 3 are in grayscale or quark completely quits…Is there something wrong with the loop or something?


-- This droplet processes both files or folders of files dropped onto the applet 
property thepath : ""

on open these_items
     set thepath to (choose folder) as text

	repeat with i from 1 to the count of these_items
		set this_item to (item i of these_items)
		process_item(item i of these_items)
	end repeat
end open

-- this sub-routine prints the files 
on process_item(this_item)
	tell application "QuarkXPress 4.11 NL"
		activate
		open this_item use doc prefs yes remap fonts no
		tell document 1
		     set doc_name to name
			tell print setup
				set printertype to "PD{Printdrive_2}-X-8_6"
			end tell
			set PS_file_path to coerce (thepath & doc_name & ".ps") to string
			print PostScript file PS_file_path
			close saving no
		end tell
	end tell
end process_item

Any suggestions are welcome!

TIA, fuut