Help with Apple Script Code
Hi,
I found this Apple script online and here's how it works:
tell application "QuickTime Player"
activate
try
if not (exists document 1) then display dialog "Please open a QuickTime movie." buttons {"Cancel"} default button 1 with icon 1
set thefile to (choose file name)
save document 1 in thefile
close document 1
end try
end tell
+I run the Apple script+
*1. It prompts me to open a movie file in Quicktime*
+I open a movie in Quicktime+
*2. It prompts me for an name and directory to save the new file in*
+I enter a name and directory+
*3. It saves a new reference movie in said directory with said name*
This is useful if I want to customize every file, but unfortunately, I just want to mass create reference movies for a whole bunch of files.
What I am looking for is for an Apple script that is a drag and drop application, so I can drop say 100 movie files or so, and have the Apple script create reference movie files with the same name and in the same directory automatically with no prompts.
Since I am unfamiliar with Apple script I was wondering if someone would be able to edit my existing script to do what I want.
Thanks so much for your help!
Use Automator. It's great for repetitious tasks (like the one you've described), and it's very user-friendly. Open Automator, create a new workflow that executes the action you want, and you can apply that action to the resources you wish to edit.
Good resource here:
http://bit.ly/
Similar Messages
-
Help with Apple Script rewrite
I can't wrap my brain around applescript. I found this program mp3gain. It is written in applescript. I just need it to go to folder abc download and run, then save it to a folder names abc done. I can reset the db from the script. Any help would be great. All the itunes stuff can be deleted.
-- MacMP3Gain.applescript
-- MacMP3Gain
-- Created by Bery Rinaldo on Tue Jan 14 2003.
-- Copyright (c) 2003-2005 Bery Rinaldo. All rights reserved.
-- This AppleScript is used to wrap the command line version of mp3gain with a quaint GUI.
-- This program is free software; you can redistribute it and/or modify it under the terms
-- of the GNU General Public License as published by the Free Software Foundation; either
-- version 2 of the License, or (at your option) any later version.
-- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-- without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-- See the GNU General Public License for more details.
-- You should have received a copy of the GNU General Public License along with this program; if not,
-- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-- This program includes a binary version of aacgain downloaded from here
-- http://www.hydrogenaudio.org/forums/index.php?act=Attach&type=post&id=1461
-- aacgain version 1.4.0, derived from mp3gain version 1.4.6
-- copyright(c) 2001-2004 by Glen Sawyer
-- AAC support copyright(c) 2004 David Lasker, Altos Design, Inc.
-- uses mpglib, which can be found at http://www.mpg123.de
-- AAC support uses faad2 (http://www.audiocoding.com), and
-- mpeg4ip's mp4v2 (http://www.mpeg4ip.net)
-- Check out the MP3Gain/AACgain web sites:
-- http://mp3gain.sourceforge.net/
-- http://altosdesign.com/aacgain/
-- Version 1.0 - Initial release
-- Version 1.01 - Added status updates to display while mp3gain is running
-- Version 1.1 - 13-Feb-2003 - Added iTunes playlist support
-- Version 1.2 - 18-Feb-2003 - Added "Process Sub-folders" option to process all folders below the selected folder.
-- Version 1.3 - 20-Feb-2003 - Fixed program hang when "Allow Clipping" checkbox was unchecked.
-- Version 1.4 - 23-Feb-2003 - Added target MP3 Gain dB value, added preferences file support for all controls
-- Version 1.5 - 26-Feb-2003 - Integrate "Be Nice" feature from Michael Heinz. Added "Cancel" feature.
-- Version 1.6 - 28-Feb-2003 - Minor GUI tweaks to "Be Nice" an "Target" buttons to disable while running.
-- Version 1.7 - 01-Nov-2003 - Update to mp3gain 1.4.3, use -k (autoClip) option when "Allow Clipping" is unchecked
-- Version 1.8 - 09-Nov-2003 - Update run_mp3gain.pl to handle iTunes 4 playlists
-- Version 1.9 - 23-Aug-2005 - Update for Tiger & AAC
property ref_folder : ""
property ref_playlist : ""
property running : false
property mp3gain : ""
property run_mp3gain : ""
on clicked theObject
if name of theObject is "Start" then
if running is true then
set title of button "Start" of window "MainWindow" to "Start"
try
set pids to do shell script "ps -auxww | egrep \"" & run_mp3gain & "|" & aacgain & "\" | grep -v grep | awk '{ print $2 }' | xargs kill"
end try
set running to false
tell progress indicator "BusyBar" of window "MainWindow" to stop
set visible of progress indicator "BusyBar" of window "MainWindow" to false
tell window "MainWindow" to update
set contents of text field "StatusMessage" of window "MainWindow" to "Processing aborted."
set enabled of button "Start" of window "MainWindow" to false
set enabled of button "Choose Folder" of window "MainWindow" to true
set enabled of button "Choose Playlist" of window "MainWindow" to true
set enabled of button "Clip" of window "MainWindow" to true
set enabled of button "Sub" of window "MainWindow" to true
set enabled of button "Target" of window "MainWindow" to true
set enabled of button "Nice" of window "MainWindow" to true
set targetchecked to state of button "Target" of window "MainWindow" as integer
if targetchecked = 1 then
set enabled of text field "TargetValue" of window "MainWindow" to true
set targetvalue to 75
try
set targetvalue to contents of default entry "TargetValue" of user defaults as integer
end try
set contents of text field "TargetValue" of window "MainWindow" to targetvalue
else
set enabled of text field "TargetValue" of window "MainWindow" to false
set contents of text field "TargetValue" of window "MainWindow" to 89
end if
set enabled of matrix "ARmatrix" of window "MainWindow" to true
set ref_folder to ""
set contents of text field "FolderPath" of window "MainWindow" to "No folder selected"
set ref_playlist to ""
set contents of text field "PlaylistName" of window "MainWindow" to "No playlist selected"
tell window "MainWindow" to update
else
set clip to (state of button "Clip" of window "MainWindow") as integer
set albumradio to current row of matrix "ARmatrix" of window "MainWindow"
set options to " -q "
if clip = 1 then
set options to options & "-c "
else
set options to options & "-k "
end if
if albumradio = 1 then
set options to options & "-a "
else
set options to options & "-r "
end if
set nicechecked to state of button "Nice" of window "MainWindow" as integer
set targetchecked to state of button "Target" of window "MainWindow" as integer
if targetchecked = 1 then
set targetdb to integer value of text field "TargetValue" of window "MainWindow"
set targetparam to targetdb - 89
set options to options & "-m " & (targetparam as string) & " "
end if
set can_run to false
if ref_playlist is not equal to "" then
set the playlist_text to ""
tell application "iTunes"
set the track_count to the count of tracks of playlist ref_playlist
repeat with z from 1 to the track_count
tell track z of playlist ref_playlist
copy {database ID} to {dbid}
end tell
set the playlist_text to the playlist_text & (dbid as string) & ","
end repeat
end tell
activate
if track_count = 0 then
display dialog "The playlist is empty." buttons {"OK"}
else
set options to options & "-P " & playlist_text
set can_run to true
end if
else
set folder_path to POSIX path of ref_folder
set sub to (state of button "Sub" of window "MainWindow") as integer
if sub = 1 then
set options to options & "-S -F \"" & folder_path & "\""
set can_run to true
else
set command to "cd \"" & folder_path & "\" ; ls *.mp3 *.m4a 2> /dev/null"
set output to do shell script command
if output is equal to "" then
display dialog "No MP3/M4A files were found in the specified folder." buttons {"OK"}
else
set options to options & "-F \"" & folder_path & "\""
set can_run to true
end if
end if
end if
if can_run is equal to true then
set enabled of button "Start" of window "MainWindow" to false
set enabled of button "Choose Folder" of window "MainWindow" to false
set enabled of button "Choose Playlist" of window "MainWindow" to false
set enabled of button "Clip" of window "MainWindow" to false
set enabled of button "Sub" of window "MainWindow" to false
set enabled of button "Target" of window "MainWindow" to false
set enabled of button "Nice" of window "MainWindow" to false
set enabled of text field "TargetValue" of window "MainWindow" to false
set enabled of matrix "ARmatrix" of window "MainWindow" to false
set visible of progress indicator "BusyBar" of window "MainWindow" to true
set uses threaded animation of progress indicator "BusyBar" of window "MainWindow" to true
tell progress indicator "BusyBar" of window "MainWindow" to start
tell window "MainWindow" to update
if nicechecked = 1 then
set command to "nice -n 1 "
else
set command to ""
end if
set command to command & "\"" & run_mp3gain & "\" " & options & " > /tmp/.mp3gain_output 2>&1"
--display dialog command
try
ignoring application responses
do shell script command & "&"
end ignoring
end try
set running to true
set title of button "Start" of window "MainWindow" to "Cancel"
set enabled of button "Start" of window "MainWindow" to true
tell window "MainWindow" to update
end if
end if
else if name of theObject is "Choose Playlist" then
tell application "iTunes"
set allPlaylists to name of user playlists
end tell
activate
set playlist_choice to choose from list allPlaylists with prompt "Which playlist?" multiple selections allowed 0
if playlist_choice is false then --nothing selected, just stop
set ref_playlist to ""
set contents of text field "PlaylistName" of window "MainWindow" to "No playlist selected."
else
set ref_playlist to playlist_choice as string
set contents of text field "PlaylistName" of window "MainWindow" to ref_playlist
set ref_folder to ""
set contents of text field "FolderPath" of window "MainWindow" to ""
set state of button "Sub" of window "MainWindow" to false
set enabled of button "Sub" of window "MainWindow" to false
set enabled of button "Start" of window "MainWindow" to true
tell window "MainWindow" to update
end if
else if name of theObject is "Sub" then
set ischecked to state of button "Sub" of window "MainWindow" as integer
try
set contents of default entry "Sub" of user defaults to ischecked
end try
else if name of theObject is "Clip" then
set ischecked to state of button "Clip" of window "MainWindow" as integer
try
set contents of default entry "Clip" of user defaults to ischecked
end try
else if name of theObject is "Nice" then
set nicechecked to state of button "Nice" of window "MainWindow" as integer
try
set contents of default entry "Nice" of user defaults to nicechecked
end try
else if name of theObject is "Target" then
set targetchecked to state of button "Target" of window "MainWindow" as integer
try
set contents of default entry "Target" of user defaults to targetchecked
end try
if targetchecked = 1 then
set enabled of text field "TargetValue" of window "MainWindow" to true
set targetvalue to 89
try
set targetvalue to contents of default entry "TargetValue" of user defaults as integer
end try
set contents of text field "TargetValue" of window "MainWindow" to targetvalue
else
set enabled of text field "TargetValue" of window "MainWindow" to false
set contents of text field "TargetValue" of window "MainWindow" to 89
end if
else if name of theObject is "ARmatrix" then
set albumradio to current row of matrix "ARmatrix" of window "MainWindow" as integer
try
set contents of default entry "AlbumRadio" of user defaults to albumradio
end try
else if name of theObject is "Choose Folder" then
set ref_folder to choose folder with prompt "Choose the folder where the MP3/M4A files are stored"
set contents of text field "FolderPath" of window "MainWindow" to ref_folder as string
set ref_playlist to ""
set contents of text field "PlaylistName" of window "MainWindow" to ""
set state of button "Sub" of window "MainWindow" to true
set enabled of button "Sub" of window "MainWindow" to true
set enabled of button "Start" of window "MainWindow" to true
tell window "MainWindow" to update
end if
end clicked
on will finish launching theObject
-- display dialog "IN the will finish launching thing"
set running to false
set mypath to POSIX path of (path to me as string)
set aacgain to mypath & "Contents/Resources/aacgain"
set run_mp3gain to mypath & "Contents/Resources/run_mp3gain.pl"
try
make new default entry at end of default entries of user defaults with properties {name:"AlbumRadio", contents:1}
end try
set albumradio to 1
try
set albumradio to contents of default entry "AlbumRadio" of user defaults as integer
end try
set current row of matrix "ARmatrix" of window "MainWindow" to albumradio
my getpreferencebutton("Clip")
my getpreferencebutton("Sub")
my getpreferencebutton("Target")
my getpreferencebutton("Nice")
try
make new default entry at end of default entries of user defaults with properties {name:"TargetValue", contents:89}
end try
set targetvalue to 89
try
set targetvalue to contents of default entry "TargetValue" of user defaults as integer
end try
set contents of text field "TargetValue" of window "MainWindow" to targetvalue
set targetchecked to state of button "Target" of window "MainWindow" as integer
if targetchecked = 1 then
set enabled of text field "TargetValue" of window "MainWindow" to true
else
set enabled of text field "TargetValue" of window "MainWindow" to false
set contents of text field "TargetValue" of window "MainWindow" to 89
end if
set visible of progress indicator "BusyBar" of window "MainWindow" to false
tell window "MainWindow" to update
set visible of window "MainWindow" to true
end will finish launching
on will close theObject
quit
end will close
on changed theObject
set targetdb to integer value of text field "TargetValue" of window "MainWindow"
try
set contents of default entry "TargetValue" of user defaults to targetdb
end try
end changed
on idle
-- display dialog "idle " & running
if running is true then
set psout to ""
set stout to ""
try
set psout to do shell script "ps -auxww | grep \"" & run_mp3gain & "\" | grep -v grep"
set stout to do shell script "grep -a -v '^$' /tmp/.mp3gain_output | tail -1"
end try
if stout = "" then
if ref_playlist is not equal to "" then
set stout to "Processing iTunes playlist " & ref_playlist & " ..."
else
set stout to "Processing folder " & ref_folder & " ..."
end if
else
set stlen to length of stout
if stlen > 75 then
set firstpart to (characters 1 through 30 of stout) as string
set startlast to stlen - 30
set lastpart to (characters startlast through stlen of stout) as string
set stout to firstpart & "..." & lastpart
end if
end if
set contents of text field "StatusMessage" of window "MainWindow" to stout
tell window "MainWindow" to update
if psout is equal to "" then
set running to false
set title of button "Start" of window "MainWindow" to "Start"
tell progress indicator "BusyBar" of window "MainWindow" to stop
set visible of progress indicator "BusyBar" of window "MainWindow" to false
tell window "MainWindow" to update
set contents of text field "StatusMessage" of window "MainWindow" to "Processing complete."
set enabled of button "Start" of window "MainWindow" to false
set enabled of button "Choose Folder" of window "MainWindow" to true
set enabled of button "Choose Playlist" of window "MainWindow" to true
set enabled of button "Clip" of window "MainWindow" to true
set enabled of button "Sub" of window "MainWindow" to true
set enabled of button "Target" of window "MainWindow" to true
set enabled of button "Nice" of window "MainWindow" to true
set targetchecked to state of button "Target" of window "MainWindow" as integer
if targetchecked = 1 then
set enabled of text field "TargetValue" of window "MainWindow" to true
else
set enabled of text field "TargetValue" of window "MainWindow" to false
set contents of text field "TargetValue" of window "MainWindow" to 89
end if
set enabled of matrix "ARmatrix" of window "MainWindow" to true
set ref_folder to ""
set contents of text field "FolderPath" of window "MainWindow" to "No folder selected"
set ref_playlist to ""
set contents of text field "PlaylistName" of window "MainWindow" to "No playlist selected"
tell window "MainWindow" to update
end if
end if
return 1
end idle
on will quit theObject
if running is true then
try
set pids to do shell script "ps -auxww | egrep \"" & run_mp3gain & "|" & aacgain & "\" | grep -v grep | awk '{ print $2 }' | xargs kill"
end try
end if
end will quit
on getpreferencebutton(buttonname)
try
-- this is how to initialize the preferences mechanism...it will not reset the value if one exists already
make new default entry at end of default entries of user defaults with properties {name:buttonname, contents:0}
end try
set value to 0
try
set value to contents of default entry buttonname of user defaults as integer
end try
if value = 1 then
set state of button buttonname of window "MainWindow" to true
else
set state of button buttonname of window "MainWindow" to false
end if
end getpreferencebuttonhi riker123
it is written in applescript, but it is written for AppleScript Studio & Xcode which has now been superseded by AppleScriptObjC & Xcode, used under OSX 10.6
Looking at your Mac specs you could use AppleScript Studio & Xcode
to set this code up, you will find a copy of Xcode on your OSX installer disk.
Not to discourage you but Xcode needs a bit of work to get the hang off,
but that's part of the fun.
Budgie -
Help with Apple Error Code & Intermitant Boot Up Problems and ? marks
Well that was a long winded Subject line but I am a technical individual ... but know PC's and learn the Mac world which I have fallen in love with.
Recently I have been getting lock up as well as hanging boot ups with the flashing question mark on the screen.
I have been doing some research and one of the most recent things I did was run the Apple Hardware Test. During the quick test I received the following erro message:
4M0T/ 40000003: HDD
I am feeling like this likely a hard drive problem but not certain. I was trying to find what this error code meant and havent any luck yet so I thought I would try and post here. If I could find the error codes it woul dbe helpful. But if you have any ideas please help me out.
I have had session lock up where I can not do anything but move the mouse, totally frozen sessions, as well as boot ups.
One of the things I did earlier was run the TechTools System Tools that came with my Imac. It said everything was fine. So confused with what is wrong.For an iMac 24 inch (Early 2008) 3.06 GHz machine, the 4MOT error code* indicates a fan issue, and recommends that a technician…
• shut down, the power back on and retest the machine
• verify that the fan speed indicator is not a zero value (yours is reporting a 3)
Without special tools and substantial experience, and because doing so would require opening your machine and thereby invalidating its existing warranty, they indicate that a technician should…
• verify that the fan blades are not obstructed by cables, tape or other obstacles
• verify that the fans are properly connected to the logic board and rotate when the machine is started
• if the problem persists, replace the fans and retest the machine
• if it still persists, replace the logic board
While HDD is a commonly used abbreviation for hard disk or hard drive, there is no Apple Hardware Test error indicator for a hard drive for this particular platform, and yours does not relate to one based upon that AHT result. While there may be a sensor issue in play, AHT does not report a sensor issue in your case.
You may wish to run the SMART diagnostics against your drive to see if it indicates an impending failure, but what you report is limited strictly to fan operation. You should take your covered machine into a dealer or service provider in order to have it tested and repaired under warranty.
*NOTE: these error codes are often non-unique, and can mean very different things from one model series to another, and—within one product family—from one specific machine type to another. -
Help with apple script for Chapter Markers (on each edit)
Hi,
My goal:
Add for each edit in the sequence a chapter marker til the end of the sequence.
(Bonus track would be: Name the marker like the current clipname )
so far I could work it out, with a lot of googling.... but:
Not working: character "a" is not typed, no idea why ?
Not working: goto begin of sequnce at the beginning
And: I need something like a loop til the end of the sequence
help very appreciated !
thanks
P.S.: I work tith FCP 7
Here's my code so far:
tell application "Final Cut Pro"
activate
tell application "System Events"
delay 0.5
key code 34 using {shift down} #Go to Begin
delay 0.5
key code 125 # Arrow Down, next edit
delay 0.2
key code 46 #Create a marker
delay 0.2
key code 46 #Edit the marker title
delay 0.2
key code 48 # TAB
delay 0.2
key code 50 # <
delay 0.2
key code 8 using {shift down} # C
delay 0.2
key code 4 # h
delay 0.5
key code 128 # a
delay 0.2
key code 35 # p
delay 0.2
key code 17 # t
delay 0.2
key code 14 # e
delay 0.2
key code 15 # r
delay 0.2
key code 50 using {shift down} # >
delay 0.5
key code 76 #Enter, Get out of marker window
delay 0.5
key code 125 # Arrow Down
end tell
end tellUse Automator. It's great for repetitious tasks (like the one you've described), and it's very user-friendly. Open Automator, create a new workflow that executes the action you want, and you can apply that action to the resources you wish to edit.
Good resource here:
http://bit.ly/ -
Hi All,
Every so often I have to delete an application from my mac. Since this involves opening 6 specific folders and trashing a file from within each I thought I could automate this.
I've opened all the relevant windows in Finder, open AppleScript, hit "record" and then move each of the items into the trash (some require password entry to do this). When I have finished, I hit "stop" but there's nothing there, it hasn't recorded anything. Am I missing something (knowledge maybe?)
Thanks
GThe Finder has a command to delete items (move them to the trash), and the command line has commands to remove items (although you need to be very careful), so it would just be a matter of making a list of the paths of the files you want to remove, for example:
tell application "Finder"
delete file "path:to:file"
-- empty trash
end tell -
I need a little help with Apple Script. I have been using a script for several months now, and all of a sudden it just stopped working. Here's the script"
============
with timeout of 9999 seconds
tell application "Finder"
activate
(* copy target file to another disk - to create a backup *)
duplicate file "Daily.dmg" of folder "File Backups" of disk "HD Mirror" to folder "Data Backup-Daily" of disk "MacHD 1" replacing yes
(* copy a 2nd target file to another disk - to create a backup *)
duplicate file "Personal.dmg" of folder "File Backups" of disk "HD Mirror" to folder "Data Backup-Daily" of disk "MacHD 1" replacing yes
(* now copy the 2nd target file to my iDisk *)
duplicate file "Personal.dmg" of folder "Data Backup-Daily" of disk "MacHD 1" to folder "Documents" of disk "xxxxxx" replacing yes
end tell
end timeout
============
In the above script, xxxxxx represents the name of my iDisk that is mounted in the Finder.
Here's my issue - the above script worked fine until just recently. However, now the first two steps work fine, but I get this error message while trying to copy the file to my iDisk:
"The operation could not be completed because some items had to be skipped. 'Personal.dmg'"
Does anyone have any ideas on how I can fix this? I'm wondering if Mac OS 10.4.5 might be the culprit since this problem seems to have occurred shortly after I upgraded???
Thanks,
-AstraPointHi,
Assumptions :-
uuencode command exits
mailx command exits
File name is "vas.txt".
Mail id is "[email protected]"
# START OF SCRIPT
#!/bin/ksh
vasFileName="$1"
vasRecordsDirFile=/etl/dev/work/wellness/enrl_rej/records/${vasFileName}
vasMetatdataDirFile=/etl/dev/work/wellness/enrl_rej/metadata/${vasFileName}
vasHeaderDirFile=/etl/dev/work/wellness/enrl_rej/header/${vasFileName}
vasHeaderRejDirFile=/etl/dev/work/wellness/enrl_rej/hdrrej/${vasFileName}
vasFieldsDirFile=/etl/dev/work/wellness/enrl_rej/fields/${vasFileName}
if [[ -e ${vasRecordsDirFile} ]]
then
uuencode ${vasRecordsDirFile} ${vasRecordsDirFile} | mailx -s "process complete and attached are the rejected records" [email protected]
elif [[ -e ${vasMetatdataDirFile} ]]
then
uuencode ${vasMetatdataDirFile} ${vasMetatdataDirFile} | mailx -s "Metadata Mismatch no of fields in detail didn't match" [email protected]
elif [[ -e ${vasHeaderDirFile} ]]
then
uuencode ${vasHeaderDirFile} ${vasHeaderDirFile} | mailx -s "Problem with header file - File Rejected" [email protected]
elif [[ -e ${vasHeaderRejDirFile} ]]
then
uuencode ${vasHeaderRejDirFile} ${vasHeaderRejDirFile} | mailx -s "the Percentage of rejects more than 3 percent File rejected" [email protected]
elif [[ -e ${vasFieldsDirFile} ]]
then
uuencode ${vasFieldsDirFile} ${vasFieldsDirFile} | mailx -s "The header and detail count didn't match File rejected" [email protected]
else
echo "File doesn't exist in any of the directories mentioned."
fi
# END
Vijay Bheemineni. -
Move a mouse with Apple script
Hello,
I need some apple script code to move a mouse to a certain location and then click. If possible could it record the location of the mouse, move it to the pre-assigned coordinates, click, and them move it back to where it was.
I am doing this so I can use multivid and Qlab to play different videos on different iOS devices. Multivid doesn't seem to let me have a cue list with different videos playing simultaneously.
I will have my iMac set up with 2 displays, one with Qlab and the other with multivid in full screen.
Thanks for the helpHere's another code using rubycocoa you might try.
_rb_click({|:position|:{30, 10}, |:click|:1, |:restore|:true, |:prep|:false})
on _rb_click(desc)
record desc : event descriptor record;
full spec = {|:position|:pos, |:click|:k, |:button|:b, |:flags|:m, |:restore|:r, |:prep|:p}
defaults = {|:position|:{}, |:click|:0, |:button|:1, |:flags|:"", |:restore|:false, |:prep|:true}
list pos : {x, y} or {}
number x, y = x, y global coordinate of position
{} denotes current location
integer k : click count (0, 1, 2 or 3}; 0 denotes only to move mouse and exit
integer b : button index (1 = left button, 2 = right button)
string m : modifier flags; e.g. 'ck' = control + command
a = capslock
s = shift
c = control
o = option
k = command
boolean r : true to restore original mouse location, false otherwise
boolean p : true to post preparatory left 1-click event to change UI context, false otherwise
return list : {x, y} = mouse location at exit
considering numeric strings
if (system info)'s system version < "10.9" then
set ruby to "/usr/bin/ruby"
else
set ruby to "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby"
end if
end considering
set defaults to {|:position|:{}, |:click|:0, |:button|:1, |:flags|:"", |:restore|:false, |:prep|:true}
set {|:position|:pos, |:click|:k, |:button|:b, |:flags|:m, |:restore|:r, |:prep|:p} to desc & defaults
if pos = {} then
set {x, y} to {"%", "%"}
else
set {x, y} to pos
end if
if k is not in {0, 1, 2, 3} then error "invalid click count: " & k number 8000
if b is not in {1, 2} then error "invalid button index: " & b number 8000
if m = "" then set m to "%"
do shell script ruby & " <<'EOF' - " & x & " " & y & " " & k & " " & b & " " & m & " " & r & " " & p & "
require 'osx/cocoa'
include OSX
if ARGV[0..1] == ['%', '%']
pt = CGEventGetLocation(CGEventCreate(nil)) # current mouse location
else
pt = CGPoint.new
pt.x, pt.y = ARGV[0..1].map {|a| a.to_f}
end
clk, btn = ARGV[2..3].map {|a| a.to_i}
flg = ARGV[4]
res, prep = ARGV[5..6].map {|a| a == 'true'}
etype, mbtn = case btn
when 1 then [KCGEventLeftMouseDown, KCGMouseButtonLeft] # [1, 0]
when 2 then [KCGEventRightMouseDown, KCGMouseButtonRight] # [3, 1]
when 3 then [KCGEventOtherMouseDown, KCGMouseButtonCenter] # [25, 2]
else raise ArgumentError, %[invalid mouse button: #{btn}]
end
mtable = {
'a' => KCGEventFlagMaskAlphaShift,
's' => KCGEventFlagMaskShift,
'c' => KCGEventFlagMaskControl,
'o' => KCGEventFlagMaskAlternate,
'k' => KCGEventFlagMaskCommand,
mf = flg.split(//).inject(0) { |mf, x| (m = mtable[x]) ? mf | m : mf }
src = CGEventSourceCreate(KCGEventSourceStateHIDSystemState)
tap = KCGHIDEventTap
pt0 = CGEventGetLocation(CGEventCreate(src)) # current mouse location
# move mouse to target location
ev0 = CGEventCreateMouseEvent(src, KCGEventMouseMoved, pt, 0) # move mouse
CGEventPost(tap, ev0)
if clk == 0
puts pt.x, pt.y
exit
end
# post preparatory left mouse click to change UI context (optional)
if prep
ev1 = CGEventCreateMouseEvent(src, KCGEventLeftMouseDown, pt, KCGMouseButtonLeft) # mouse left button down
CGEventPost(tap, ev1)
CGEventSetType(ev1, KCGEventLeftMouseUp) # mouse left button up
CGEventPost(tap, ev1)
end
# post target mouse click(s) with given flags
ev = CGEventCreateMouseEvent(src, etype, pt, mbtn) # mouse button down
CGEventSetFlags(ev, mf) # set flags
CGEventSetIntegerValueField(ev, KCGMouseEventClickState, clk) # set click count
CGEventPost(tap, ev)
CGEventSetType(ev, etype + 1) # mouse button up
CGEventPost(tap, ev)
# restore mouse location (optional)
if res
CGEventSetLocation(ev0, pt0) # restore mouse location
CGEventPost(tap, ev0)
puts pt0.x, pt0.y
exit
end
puts pt.x, pt.y
EOF"
set rr to paragraphs of result
repeat with r in rr
set r's contents to r as number
end repeat
return rr
end _rb_click -
Purchased DVD in US for Cdn viewing. Digital download will not work in Cda or US? please help with new Digital code that will work
You will need to contact the movie studio that produced the DVD and ask if they can issue you a new code valid for Canada. Apple cannot help you, and everyone here in these forums is just a fellow user.
Regards. -
Need help with a activation code for Adobe Acrobat X Standard for my PC, Don't have older Version of Adobe Acrobat 9, 8 or 7.
You don't need to install the older version, you only need the serial number from your original purchase. If you don't have them to hand, did you register? If so, they should be in your Adobe account. If not you really need to contact Adobe, though it isn't clear they will be able to do anything without some proof of purchase etc.
-
Open multi page pdf specific page in Illustrator CS4 with apple script
I need to open multi page pdf specific page in Illustrator CS4 with apple script. Is it something like this:
activate (open file theTargetFolder as PDF with options …).
Thank you.Carlos,
Muchas Gracias por tu colaboración y excelente script, el que se abra el ESTK no tiene mayor importancia.
El caso es que Adobe recomienda encarecidamente NO utilizar Illustrator para editar PDFs, por diversas razones, aunque cuando no hay otro remedio o herramienta disponible, o conocida ...
Para llegar aquí, aparte de San Google, hay que ir a Adobe.es (en mi caso), pestaña de Ayuda, ..... (hasta aqui bien),
luego hay que bajar hasta el final y ver Comunidad y Foros...... (esto puede ser)
al pulsar aparacen un montón de foros se supone de programas pero en inglés,
y la última línea es de International Forums, ya casi hemos llegado)
pulsamos entonces, y por fin se abren cuatro palabras con idiomas, en una dice: español (casi no me lo puede creer)
pincho y llego por fin aquí.
Muy poca gente sabe de la existencia de este pequeño refugio, si a esta dificultad añadimos la peculiar forma de ser de la gente, .... -
Can someone post apple script code to tell Safari to refresh every 5 min?
Can someone post apple script code to tell Safari to refresh every 5 min?
thanx in advance!save the script as an application and checkmark the "Stay Open" box
-- start script
on idle
tell application "Safari"
activate
set doc_url to URL of document 1
open location doc_url
end tell
return 15 --<change the number 15 to the number of seconds you want between each refresh
end idle
-- end script
<br>
Mac OS X (10.4.7) -
Auto refresh with apple script- help please
can any one help me please
i use multiple windows in safari at one time and can any one help me to refresh these pages (two windows) automatically using apple script.
also if I click manually to refresh these pages i get the following note"
"To open this page again, Safari must resend the form you completed to open the page the first time. This may cause the website to repeat actions it took the first time you sent the form."
and i have click send for this to happen
any help from you all will be appreciated as this will help me a lot with the present work that i am doingNot sure about the "automatic" reload - Opera allows you to set a refresh time interval for each tab, but not Safari. Also, Safari Extender gives you a single click contextual menu option to "reload all tabs".
here is an AppleScript for a one-page auto reload. You might be able to alter the script to auto reload all open tabs.
Not sure about the "warning" message. Can you post a URL so I can have a look? -
NEED a java coder to help with a script for a programs of mine.
I play a game, very competitively, and need someone to make and compile a script for me. I am willing to pay upwards of 100 USD for this script made to MY standards. There will be a lot of work involved...Probably 12 hours studying my game and the purpose of the script(s). I will be buying 2-3 scripts, at roughly 50-100 USD each, depending on the quality. I will transfer the money via paypal, or other means if we can reach an agreement.
Please IM me at Chadtrapier on AIM or send an email to [email protected]
Or...Add me on MSN - [email protected]
We can reach an agreement with these scripts...
Thank you, I will also check this thread, so reply if you would like.
~ChadUmmm. Do you think that's a lot of money or something? Think in the range of 40-60 per hour. And if you're talking about warcraft I don't think they java hooks to make bots. I think you need to figure out what your problem is first and maybe learn to code them yourself.
-
So , I edited the ITunes.java as described in the Admin guide.Copied the .class to my cgi folder in the server.I copied the itunesu file from the shell folder of the sample code.I have modified it accordingly.But when I run it in browser(Firefox) as ..../cgi-bin/itunesu it just gives me a blank page.Nothing shows up.I ran the ITunes.java file locally and it generates an HTML output, which I copied and created a new html.After I run this HTML file, it opens my itunes, but again it says page not found and url contains https://www.xxx.edu/cgi-bin/itunesu?destination=xxx.edu where xxx is my institution name.Not sure if I am supposed to display my institution name in forum.
The admin guide says on page 15 step 4.Copy the itunes.class file and other itunes file to your web server's cgi-bin directory.
I am not quiet sure what does other itunes file mean??
This is how my .java file looks.
import java.io.*;
import java.net.*;
import java.security.*;
import java.util.*;
* The <CODE>ITunesU</CODE> class permits the secure transmission
* of user credentials and identity between an institution's
* authentication and authorization system and iTunes U.
* The code in this class can be tested by
* running it with the following commands:
* <PRE>
* javac ITunesU.java
* java ITunesU</PRE>
* Changes to values defined in this class' main() method must
* be made before it will succesfully communicate with iTunes U.
public class ITunesU extends Object {
* Generate the HMAC-SHA256 signature of a message string, as defined in
* RFC 2104.
* @param message The string to sign.
* @param key The bytes of the key to sign it with.
* @return A hexadecimal representation of the signature.
public String hmacSHA256(String message, byte[] key) {
// Start by getting an object to generate SHA-256 hashes with.
MessageDigest sha256 = null;
try {
sha256 = MessageDigest.getInstance("SHA-256");
} catch (NoSuchAlgorithmException e) {
throw new java.lang.AssertionError(
this.getClass().getName()
+ ".hmacSHA256(): SHA-256 algorithm not found!");
// Hash the key if necessary to make it fit in a block (see RFC 2104).
if (key.length > 64) {
sha256.update(key);
key = sha256.digest();
sha256.reset();
// Pad the key bytes to a block (see RFC 2104).
byte block[] = new byte[64];
for (int i = 0; i < key.length; ++i) block = key;
for (int i = key.length; i < block.length; ++i) block = 0;
// Calculate the inner hash, defined in RFC 2104 as
// SHA-256(KEY ^ IPAD + MESSAGE)), where IPAD is 64 bytes of 0x36.
for (int i = 0; i < 64; ++i) block ^= 0x36;
sha256.update(block);
try {
sha256.update(message.getBytes("UTF-8"));
} catch (UnsupportedEncodingException e) {
throw new java.lang.AssertionError(
"ITunesU.hmacSH256(): UTF-8 encoding not supported!");
byte[] hash = sha256.digest();
sha256.reset();
// Calculate the outer hash, defined in RFC 2104 as
// SHA-256(KEY ^ OPAD + INNER_HASH), where OPAD is 64 bytes of 0x5c.
for (int i = 0; i < 64; ++i) block ^= (0x36 ^ 0x5c);
sha256.update(block);
sha256.update(hash);
hash = sha256.digest();
// The outer hash is the message signature...
// convert its bytes to hexadecimals.
char[] hexadecimals = new char[hash.length * 2];
for (int i = 0; i < hash.length; ++i) {
for (int j = 0; j < 2; ++j) {
int value = (hash >> (4 - 4 * j)) & 0xf;
char base = (value < 10) ? ('0') : ('a' - 10);
hexadecimals[i * 2 + j] = (char)(base + value);
// Return a hexadecimal string representation of the message signature.
return new String(hexadecimals);
* Combine user credentials into an appropriately formatted string.
* @param credentials An array of credential strings. Credential
* strings may contain any character but ';'
* (semicolon), '\\' (backslash), and control
* characters (with ASCII codes 0-31 and 127).
* @return <CODE>null</CODE> if and only if any of the credential strings
* are invalid.
public String getCredentialsString(String[] credentials) {
// Create a buffer with which to generate the credentials string.
StringBuffer buffer = new StringBuffer();
// Verify and add each credential to the buffer.
if (credentials != null) {
for (int i = 0; i < credentials.length; ++i) {
if (i > 0) buffer.append(';');
for (int j = 0, n = credentials.length(); j < n; ++j) {
char c = credentials.charAt(j);
if (c != ';' && c != '\\' && c >= ' ' && c != 127) {
buffer.append(c);
} else {
return null;
// Return the credentials string.
return buffer.toString();
* Combine user identity information into an appropriately formatted string.
* @param displayName The user's name (optional).
* @param emailAddress The user's email address (optional).
* @param username The user's username (optional).
* @param userIdentifier A unique identifier for the user (optional).
* @return A non-<CODE>null</CODE> user identity string.
public String getIdentityString(String displayName, String emailAddress,
String username, String userIdentifier) {
// Create a buffer with which to generate the identity string.
StringBuffer buffer = new StringBuffer();
// Define the values and delimiters of each of the string's elements.
String[] values = { displayName, emailAddress,
username, userIdentifier };
char[][] delimiters = { { '"', '"' }, { '<'(', ')' }, { '[', ']' } };
// Add each element to the buffer, escaping
// and delimiting them appropriately.
for (int i = 0; i < values.length; ++i) {
if (values != null) {
if (buffer.length() > 0) buffer.append(' ');
buffer.append(delimiters[0]);
for (int j = 0, n = values.length(); j < n; ++j) {
char c = values.charAt(j);
if (c == delimiters[1] || c == '\\') buffer.append('\\');
buffer.append(c);
buffer.append(delimiters[1]);
// Return the generated string.
return buffer.toString();
* Generate an iTunes U digital signature for a user's credentials
* and identity. Signatures are usually sent to iTunes U along
* with the credentials, identity, and a time stamp to warrant
* to iTunes U that the credential and identity values are
* officially sanctioned. For such uses, it will usually makes
* more sense to use an authorization token obtained from the
* {@link #getAuthorizationToken(java.lang.String, java.lang.String, java.util.Date, byte[])}
* method than to use a signature directly: Authorization
* tokens include the signature but also the credentials, identity,
* and time stamp, and have those conveniently packaged in
* a format that is easy to send to iTunes U over HTTPS.
* @param credentials The user's credentials string, as
* obtained from getCredentialsString().
* @param identity The user's identity string, as
* obtained from getIdentityString().
* @param time Signature time stamp.
* @param key The bytes of your institution's iTunes U shared secret key.
* @return A hexadecimal representation of the signature.
public String getSignature(String credentials, String identity,
Date time, byte[] key) {
// Create a buffer in which to format the data to sign.
StringBuffer buffer = new StringBuffer();
// Generate the data to sign.
try {
// Start with the appropriately encoded credentials.
buffer.append("credentials=");
buffer.append(URLEncoder.encode(credentials, "UTF-8"));
// Add the appropriately encoded identity information.
buffer.append("&identity=");
buffer.append(URLEncoder.encode(identity, "UTF-8"));
// Add the appropriately formatted time stamp. Note that
// the time stamp is expressed in seconds, not milliseconds.
buffer.append("&time=");
buffer.append(time.getTime() / 1000);
} catch (UnsupportedEncodingException e) {
// UTF-8 encoding support is required.
throw new java.lang.AssertionError(
"ITunesU.getSignature(): UTF-8 encoding not supported!");
// Generate and return the signature.
String signature = this.hmacSHA256(buffer.toString(), key);
return signature;
* Generate and sign an authorization token that you can use to securely
* communicate to iTunes U a user's credentials and identity. The token
* includes all the data you need to communicate to iTunes U as well as
* a creation time stamp and a digital signature for the data and time.
* @param credentials The user's credentials string, as
* obtained from getCredentialsString().
* @param identity The user's identity string, as
* obtained from getIdentityString().
* @param time Token time stamp. The token will only be valid from
* its time stamp time and for a short time thereafter
* (usually 90 seconds).
* @param key The bytes of your institution's iTunes U shared secret key.
* @return The authorization token. The returned token will
* be URL-encoded and can be sent to iTunes U with
* a form
* submission. iTunes U will typically respond with
* HTML that should be sent to the user's browser.
public String getAuthorizationToken(String credentials, String identity,
Date time, byte[] key) {
// Create a buffer with which to generate the authorization token.
StringBuffer buffer = new StringBuffer();
// Generate the authorization token.
try {
// Start with the appropriately encoded credentials.
buffer.append("credentials=");
buffer.append(URLEncoder.encode(credentials, "UTF-8"));
// Add the appropriately encoded identity information.
buffer.append("&identity=");
buffer.append(URLEncoder.encode(identity, "UTF-8"));
// Add the appropriately formatted time stamp. Note that
// the time stamp is expressed in seconds, not milliseconds.
buffer.append("&time=");
buffer.append(time.getTime() / 1000);
// Generate and add the token signature.
String data = buffer.toString();
buffer.append("&signature=");
buffer.append(this.hmacSHA256(data, key));
} catch (UnsupportedEncodingException e) {
// UTF-8 encoding support is required.
throw new java.lang.AssertionError(
"ITunesU.getAuthorizationToken(): "
+ "UTF-8 encoding not supported!");
// Return the signed authorization token.
return buffer.toString();
* Send a request for an action to iTunes U with an authorization token.
* @param url URL defining how to communicate with iTunes U and
* identifying which iTunes U action to invoke and which iTunes
* U page or item to apply the action to. Such URLs have a
* format like <CODE>[PREFIX]/[ACTION]/[DESTINATION]</CODE>,
* where <CODE>[PREFIX]</CODE> is a value like
* "https://deimos.apple.com/WebObjects/Core.woa" which defines
* how to communicate with iTunes U, <CODE>[ACTION]</CODE>
* is a value like "Browse" which identifies which iTunes U
* action to invoke, and <CODE>[DESTINATION]</CODE> is a value
* like "example.edu" which identifies which iTunes U page
* or item to apply the action to. The destination string
* "example.edu" refers to the root page of the iTunes U site
* identified by the domain "example.edu". Destination strings
* for other items within that site contain the site domain
* followed by numbers separated by periods. For example:
* "example.edu.123.456.0789". You can find these
* strings in the items' URLs, which you can obtain from
* iTunes. See the iTunes U documentation for details.
* @param token Authorization token generated by getAuthorizationToken().
* @return The iTunes U response, which may be HTML or
* text depending on the type of action invoked.
public String invokeAction(String url, String token) {
// Send a request to iTunes U and record the response.
StringBuffer response = null;
try {
// Verify that the communication will be over SSL.
if (!url.startsWith("https")) {
throw new MalformedURLException(
"ITunesU.invokeAction(): URL \""
+ url + "\" does not use HTTPS.");
// Create a connection to the requested iTunes U URL.
HttpURLConnection connection =
(HttpURLConnection)new URL(url).openConnection();
connection.setUseCaches(false);
connection.setDoOutput(true);
connection.setRequestMethod("POST");
connection.setRequestProperty(
"Content-Type",
"application/x-www-form-urlencoded; charset=UTF-8");
// Send the authorization token to iTunes U.
connection.connect();
OutputStream output = connection.getOutputStream();
output.write(token.getBytes("UTF-8"));
output.flush();
output.close();
// Read iTunes U's response.
response = new StringBuffer();
InputStream input = connection.getInputStream();
Reader reader = new InputStreamReader(input, "UTF-8");
reader = new BufferedReader(reader);
char[] buffer = new char[16 * 1024];
for (int n = 0; n >= 0;) {
n = reader.read(buffer, 0, buffer.length);
if (n > 0) response.append(buffer, 0, n);
// Clean up.
input.close();
connection.disconnect();
} catch (UnsupportedEncodingException e) {
// ITunes U requires UTF-8 and ASCII encoding support.
throw new java.lang.AssertionError(
"ITunesU.invokeAction(): UTF-8 encoding not supported!");
} catch (IOException e) {
// Report communication problems.
throw new java.lang.AssertionError(
"ITunesU.invokeAction(): I/O Exception " + e);
// Return the response received from iTunes U.
return response.toString();
* iTunes U credential and identity transmission sample. When your
* itunes U site is initially created, Apple will send your institution's
* technical contact a welcome email with a link to an iTunes U page
* containing the following information, which you will need to customize
* this method's code for your site:
<DD><DL><DT>
* Information:<DD><CODE>
* Site URL</CODE> - The URL to your site in iTunes U. The last
* component of that URL, after the last slash,
* is a domain name that uniquely identifies your
* site within iTunes U.<DD><CODE>
* shared secret</CODE> - A secret key known only to you and Apple that
* allows you to control who has access to your
* site and what access they have to it.<DD><CODE>
* debug suffix</CODE> - A suffix you can append to your site URL
* to obtain debugging information about the
* transmission of credentials and identity
* information from your institution's
* authentication and authorization services
* to iTunes U.<DD><CODE>
* administrator credential</CODE> - The credential string to assign
* to users who should have the
* permission to administer your
* iTunes U site.</DL></DD>
<DD>
* Once you have substitute the information above in this method's code
* as indicated in the code's comments, this method will connect
* to iTunes U and obtain from it the HTML that needs to be returned to a
* user's web browser to have a particular page or item in your iTunes U
* site displayed to that user in iTunes. You can modify this method to
* instead output the URL that would need to be opened to have that page
* or item displayed in iTunes.</DD>
public static void main(String argv[]) {
// Define your site's information. Replace these
// values with ones appropriate for your site.
String siteURL =
"https://deimos.apple.com/WebObjects/Core.woa/Browse/xxx.edu" ;
String debugSuffix = "/abc123";
String sharedSecret = "some key";
String administratorCredential =
"Administrator@urn:mace:itunesu.com:sites:xxx.edu";
// Define the user information. Replace the credentials with the
// credentials you want to grant to the current user, and the
// optional identity information with the identity of that user.
// For initial testing and site setup, use the singe administrator
// credential defined when your iTunes U site was created. Once
// you have access to your iTunes U site, you will be able to define
// additional credentials and the iTunes U access they provide.
String[] credentialsArray = { administratorCredential };
String displayName = "my name";
String emailAddress = "my [email protected]";
String username = "mylogin";
String userIdentifier = "1243";
// Define the iTunes U page to browse. Use the domain name that
// uniquely identifies your site in iTunes U to browse to that site's
// root page; use a destination string extracted from an iTunes U URL
// to browse to another iTunes U page; or use a destination string
// supplied as the "destination" parameter if this program is being
// invoked as a part of the login web service for your iTunes U site.
String siteDomain = siteURL.substring(siteURL.lastIndexOf('/') + 1);
String destination = siteDomain;
// Append your site's debug suffix to the destination if you want
// to receive an HTML page providing information about the
// transmission of credentials and identity between this program
// and iTunes U. Uncomment the following line for testing only.
//destination = destination + debugSuffix;
// Use an ITunesU instance to format the credentials and identity
// strings and to generate an authorization token for them.
ITunesU iTunesU = new ITunesU();
String identity = iTunesU.getIdentityString(displayName, emailAddress,
username, userIdentifier);
String credentials = iTunesU.getCredentialsString(credentialsArray);
Date now = new Date();
byte[] key = null;
try {
key = sharedSecret.getBytes("US-ASCII");
} catch (UnsupportedEncodingException e) {
throw new java.lang.AssertionError(
"ITunesU.hmacSH256(): US-ASCII encoding not supported!");
String token = iTunesU.getAuthorizationToken(credentials, identity,
now, key);
// Use the authorization token to connect to iTunes U and obtain
// from it the HTML that needs to be returned to a user's web
// browser to have a particular page or item in your iTunes U
// site displayed to that user in iTunes. Replace "/Browse/" in
// the code below with "/API/GetBrowseURL/" if you instead want
// to return the URL that would need to be opened to have that
// page or item displayed in iTunes.
String prefix = siteURL.substring(0, siteURL.indexOf(".woa/") + 4);
String url = prefix + "/Browse/" + destination;
String results = iTunesU.invokeAction(url, token);
System.out.println(results);
The itunes file from Shell folder has been modified as follows
DISPLAY_NAME= "myname"
EMAIL_ADDRESS="[email protected]"
USERNAME="mylogin"
USER_IDENTIFIER="1243"
all the other things in that file have been untouched.
I also generated the debug which looks like this
iTunes U Access Debugging
Received
Destination xxx.edu
Identity "my name" <[email protected]> (mylogin) [1243]
Credentials Administrator@urn:mace:itunesu.com:sites:xxx.edu
Time 1196706873
Signature 533870b8jshdidk333lfsf6a3143a55c132ec548a4d545bd79322402e8e2596e4
Analysis
The destination string is valid and the corresponding destination item was found.
The identity string is valid and provides the following information:
Display Name my name
Email Address [email protected]
Username mylogin
User Identifier 1243
The credential string is valid and contains the following recognized credential:
1. Administrator@urn:mace:itunesu.com:sites:xxx.edu
The time string is valid and corresponds to 2007-12-03 18:34:33Z.
The signature string is valid.
Access
Because the received signature and time were valid, the received identity and credentials were accepted by iTunes U.
In addition, the following 2 credentials were automatically added by iTunes U:
1. All@urn:mace:itunesu.com:sites:xxx.edu
2. Authenticated@urn:mace:itunesu.com:sites:xxx.edu
With these credentials, you have browsing, downloading, uploading, and editing access to the requested destination.
I am pretty new to this, and working on this for the first time.If someone could guide me through this would be pretty helpful.This is only going to work under IE !
Go to your page template :
Modify the definition, make sur you have this :
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>#TITLE#</title>
#HEAD#
<Script language = javascript>
Browser = navigator.appName
Net = Browser.indexOf("Netscape")
Micro = Browser.indexOf("Microsoft")
Netscape = false
IE = false
if(Net >= 0) {Netscape = true}
if(Micro >= 0) {IE = true}
function XYpos() {
if (IE == true) {
xPos = event.screenX
yPos = event.screenY
alert(xPos + " left " + yPos + " down")
else if (Netscape == true) {alert("Script won't work: " + "\n" + "You're using Netscape")}
</script>
Modify the body definition, make sure you have this :
<body #ONLOAD# onMouseDown = XYpos()>
I didnt try it but it make sens to me... tell me if it works!
Flex
Homepage : http://www.insum.ca
InSum Solutions' blog : http://insum-apex.blogspot.com -
Selecting Different Printer With Apple Script.
Hi,
I am currently in the process of making a script to be able to print off labels without the need of much user input (read from a document or e-mail) and I want to be able to set the printer when it goes to the print screen.
this is the final apple script step in the application cmd+p brings up the 1st print menu the return takes it to the second print menu cmd+v pastes predifind by the user the ammount of copys they want
on run {input, parameters}
tell application "Labels & Addresses"
activate
tell application "System Events"
keystroke "p" using command down
delay 1
keystroke return
delay 1
keystroke "v" using command down
delay 1
tell application "System Events"
tell process "Labels & Addresses"
click (menu item whose description is "Printer")
click (menu item "Zebra Technologies ZTC GK420t" whose description is "Printer")
end tell
end tell
return input
end tell
end tell
end run
now there is chance to change the printer selection twice once in the 1st print screen and once in the 2nd print screen the only problem is im not sure how to apple script to select the right printer from the drop down menu, I got the code from a forum but I think it was old code as when I tested it it was returning errors so I modified it a bit and now it just struggles finding the menu item with description of printer.
Does anyone know what I would have to use for it to select the right printer? (The Zebra Technologies ZTC GK420t)
Help would be greatly appricited!
Thanks,
Bruce
P.S. sorry the code is a bit messy!Im NOT sure if you have just made this a little over complicated… This works just fine for me. Tested with about a dozen psd layers…
tell application "Adobe InDesign CS2"
tell active document
tell rectangle 1
tell graphic 1
tell graphic layer options
set GLC to count of graphic layers
repeat with i from 1 to GLC
if name of graphic layer i ≠ "Blue" then
set current visibility of graphic layer i to false
else
set current visibility of graphic layer i to true
end if
end repeat
end tell
end tell
end tell
end tell
end tell
This variant also works as I would have expected too… Retaining visibility from a list…
tell application "Adobe InDesign CS2"
tell active document
tell rectangle 1
tell graphic 1
tell graphic layer options
set On_List to {"Red", "Aqua", "Orange"}
set GLC to count of graphic layers
repeat with i from 1 to GLC
if name of graphic layer i is not in On_List then
set current visibility of graphic layer i to false
else
set current visibility of graphic layer i to true
end if
end repeat
end tell
end tell
end tell
end tell
end tell
Maybe you are looking for
-
TS1713 Plastic covering scrapped off fully
I have scrapped off the white plastic covering in the adaptor for a t style plug in a MacBook White while trying to remove some metallic gunk. Is it still safe to use?
-
Older MacPro as an External Hard Drive
Greetings I recently moved from my 2010 MacPro to an iMac. Since the MacPro has 4 hard drive bays I was thinking of using the MacPro as an "external" hard drive. I can access the drives thru my ethernet network but I was wondering if there is a more
-
The employee at the Bell store was helping me, but he entered the wrong (non-exisitent) email address to set up my BB ID. I can't seem to change the email address. It seems to tell me to use another email, I have to do a security wipe. Is this tru
-
How to configure MM01 tabs view?
Hi experts, We have just upgraded our SAP from 4.6C to ECC6.0. Until now in tcode MM01/ MM02/ MM03, the customizing was made in such a way that to navigate from one screen to the next the user had to click on the "next screen" button. This ergonomy b
-
Export of the images on HDD in Bridge CC
How do you export the images on HDD in Bridge CC? Externaly only via PS? I have used the export fn in the Bridge CS 5 quite often. I have also LR 5.3. Shall I use the Export from there? Thx for ideas