Set "Global" to paragraph1

Hi
I’m François
I have a problem Settig “Global” to first paragraph of document 1
Can someone help me solve this problem
My script
set DocName to “ADIEU À LA NUIT”

tell document DocName of application “Safari”
activate
end tell

– Obtenir les données du document Safari : Artiste, titre, auteur et paroles
tell application “Safari”
set Artiste to first paragraph of text of document 1 – extrait le nom de l’artiste “”
set Titre to second paragraph of text of document 1 – extrait le titre de la chanson “”
set Auteur to third paragraph of text of document 1 – extrait l’auteur “”
set parcount to count every paragraph of text of document 1 – “”
set Paroles to “paragraphs 5 thru {parcount - 3} of text of document 1” – extrait les paroles uniquement “”
end tell
tell application “Finder”
activate application “FileMaker Pro”
end tell

tell application “Finder” to open file “FM_MUSIQUE”

– passer paramètres dans FileMaker Pro pour recherche et collage des paroles
tell application “FileMaker Pro”
set field “gArtiste” of current record to Artiste – replace “texte”
set field “gTitre” of current record to Titre – replace “texte”
set field “gAuteur” of current record to Auteur – replace “texte”
set field “gParoles” of current record to Paroles – replace “texte”
end tell

– faire exécuter file Maker script: “Recherche chanson et colle parole”
tell application “FileMaker Pro”
do script “Recherche chanson et colle parole”
end tell
Thanks i’d appreciate any help i can get.
Sincereley yours
François

Model: iMac
AppleScript: 2.0 (v43.1)
Browser: Safari 312.6
Operating System: Mac OS X (10.3.9)

Do you mean that you want Artiste to be a global variable? Use a property -

property Artiste : missing value
– more

set Artiste to first paragraph — etc. Now the property Artiste has that value and will retain it until you set it to something else.

If you mean you want to call a variable “global” - you can’t - It’s an AppleScript word.

If you mean to edit a post, use the “edit” link - don’t post again. I deleted two of three.

Right on, Artiste has to be a global so it can be transfered to a FileMaker “File” it doesn’t recognize "to first paragraph " set Artiste to first paragraph. “Cannot get first paragraph”
Thanks

Hello

May you try:


global artiste, titre, auteur, parcount, paroles (* not sure that it is required *)
set DocName to "ADIEU À LA NUIT"

tell document DocName of application "Safari"
    activate
end tell

-- Obtenir les données du document Safari : Artiste, titre, auteur et paroles
tell application "Safari"
    set Artiste to first paragraph of text of document 1 -- extrait le nom de l'artiste ""
    set Titre to second paragraph of text of document 1 -- extrait le titre de la chanson ""
    set Auteur to third paragraph of text of document 1 -- extrait l'auteur ""
    set parcount to count every paragraph of text of document 1 -- ""
    set Paroles to paragraphs 5 thru {parcount - 3} of text of document 1 -- extrait les paroles uniquement ""
(* dereference the variables *)
set artiste to artiste's contents
	set titre to titre's contents
	set auteur to auteur's contents
	set parcount to parcount's contents
	set paroles to paroles's contents
end tell
tell application "Finder"
    activate application "FileMaker Pro"
end tell

tell application "Finder" to open file "FM_MUSIQUE"

-- passer paramètres dans FileMaker Pro pour recherche et collage des paroles
tell application "FileMaker Pro"
    set field "gArtiste" of current record to Artiste -- replace "texte"
    set field "gTitre" of current record to Titre -- replace "texte"
    set field "gAuteur" of current record to Auteur -- replace "texte"
    set field "gParoles" of current record to Paroles -- replace "texte"
end tell

-- faire exécuter file Maker script: "Recherche chanson et colle parole"
tell application "FileMaker Pro"
    do script "Recherche chanson et colle parole"
end tell

Yvan KOENIG (from FRANCE lundi 2 octobre 2006 08:41:3)

My thanks to Yvan Koenig, your solution worked fine. I finally worked my script through fine.
After months of trials and errors, I’m finally done. It took me 24 hours of script operating to finalize my 28 thousands files.
I’d also like to thank the whole team for your getting me through my project.
Sincerely yours
Fançois